Clear Filters
Clear Filters

Saving image with high resolution

9 views (last 30 days)
hamza hamza
hamza hamza on 11 Jun 2015
Edited: Walter Roberson on 18 Aug 2024 at 4:21
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

Answers (1)

Elias G
Elias G on 17 Aug 2024 at 23:35
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
DGM on 18 Aug 2024 at 0:55
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.

Sign in to comment.

Categories

Find more on Images 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!