Saving image with high resolution
11 views (last 30 days)
Show older comments
Hi, I use this line of code to save my figure as .png : print(name,'-dpng','-r0'), but i get a bad resolution picture bespite that the figure in matlab is good. I tried print(name,'-dpng','-r500'), but nothing changed. How can i save figure as .png but with the same quality as the matlab figure? Thank you
0 Comments
Answers (1)
Elias G
on 17 Aug 2024
Hello, I recently tried to save a figure but always got a square resolution.
Finally, after maximising my own figure and saving it, the results were good.
fg = gcf;
fg.WindowState='maximized';
print(fg, myfolder_name,'-djpeg','-r0');
If you want something of higher quality, where you can zoom in without losing resolution,
you should use .eps or .svg, depending on the situation.
1 Comment
DGM
on 18 Aug 2024
If you want to use vector output, know that not all objects will be embedded in vector form. There may still be raster content.
If full raster output is okay and quality is ever any concern, then JPG is counterproductive. You're automatically throwing away at least 75% of the chroma information in the image, and in many (if not most) cases, the file size is actually larger than a PNG.
See Also
Categories
Find more on Printing and Saving in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!