How do I save an image at a specific resolution?

10 ビュー (過去 30 日間)
Joshua
Joshua 2013 年 12 月 14 日
回答済み: Palguna Gopireddy 2022 年 11 月 27 日
My MatLab knowledge is terrible. I have made some figures. I want to save them at a very high resolution as a .tiff. How can I do this? I have tried using the
imwrite
print -r
functions, but this doesn't seem to work.

採用された回答

Image Analyst
Image Analyst 2013 年 12 月 14 日
Do you want to save only the image, as an image? Or do you want to save the figure as an image? If it's just the image, that you may have displayed with imshow(), image(), or imagesc(), then you can use imwrite().
If you want to save the figure, because you have annotation (arrows, text, lines, polygons) in the overlay above the image, or you want to show axes tick marks and toolbars, then you can use saveas(). Or better than saveas() is export_fig(). See this page to download export_fig: http://www.mathworks.com/matlabcentral/fileexchange/
  2 件のコメント
Joshua
Joshua 2013 年 12 月 15 日
saveas() looks close to what I want. I create a figure with specific major and minor grid lines and a 3D image and want to save it at a high resolution for publication. I create my image, then run the code
print -r1500 % set resolution
saveas(figure(1),'test.tif') % save image as a .tiff file
Changing '-r1500' does not alter the resolution. I feel like what I am trying to do is very simple and that I am making some stupid mistake.
Joshua
Joshua 2013 年 12 月 15 日
just got it to work with
print('-dtiff','-r500',fnames)
where -dtiff is the .tiff file type, -r500 is the resolution of 500 dpi, and fnames is the saved files name.

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

その他の回答 (3 件)

Walter Roberson
Walter Roberson 2013 年 12 月 14 日

PAVITHRA  A
PAVITHRA A 2016 年 9 月 4 日
hi...i heed to get high resolution and low resolution of image from LBP processed image.how can I do this??can anybody help me...

Palguna Gopireddy
Palguna Gopireddy 2022 年 11 月 27 日
See this link.
https://in.mathworks.com/help/matlab/creating_plots/save-figure-at-specific-size-and-resolution.html

カテゴリ

Help Center および File ExchangePrinting and Saving についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by