Hiw to save the image as best resolution image

2 ビュー (過去 30 日間)
M.S. Khan
M.S. Khan 2019 年 9 月 18 日
コメント済み: KALYAN ACHARJYA 2019 年 9 月 19 日
Hi math works community,
Thanks for all support and guidance from all expert friends through out the globe.
Its a great plateform for sharing knowledge. i am really impressed.
How to save the image in the fastest way as png.
lets suppose this is the image. how to save it.
% Generate test image contains values in 0:4
[~,~,I]=histcounts(peaks,5);
I = I-1;
imagesc(I)
colormap([1 0 0; % color of 0 value
0 1 0; % color of 1 value
0 0 1; % color of 2 value
0 0 0; % color of 3 value
1 1 1])% color of 4 value
set(gca,'Clim',[-0.5 max(I(:))+0.5]);
colorbar

採用された回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 9 月 18 日
編集済み: KALYAN ACHARJYA 2019 年 9 月 18 日
How to save the image in the fastest way as png.
I am not sure about fastest way, one way:
[~,~,I]=histcounts(peaks,5);
I = I-1;
imagesc(I)
colormap([1 0 0; % color of 0 value
0 1 0; % color of 1 value
0 0 1; % color of 2 value
0 0 0; % color of 3 value
1 1 1])% color of 4 value
set(gca,'Clim',[-0.5 max(I(:))+0.5]);
colorbar
saveas(gcf,'test_image.png');
  2 件のコメント
M.S. Khan
M.S. Khan 2019 年 9 月 19 日
Thanks Mr. KALYAN ACHARJYA .
KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 9 月 19 日
It's my pleasure sir

サインインしてコメントする。

その他の回答 (0 件)

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by