MATLAB Answers

0

Printing image to file with Matlab 2014b: resolution issue

Asked by Christophe on 5 Feb 2015
Latest activity Answered by spuler
on 10 Apr 2015
I am using the print function to save figures containing large images (geographical data) as jpg or tif images:
figure(1); imagesc(My_image); print('-r600', '-djpeg', '-f1', 'My_image.jpg');
This used to work perfectly for years with previous Matlab versions. Now with Matlab 2014b, the image keeps the screen resolution whatever dpi (here 600) number is chosen: the number of pixel is behaving as expected, but the image itself keeps the same pixels as displayed on the screen, resulting only in very large squares (pixels) when using large dpi numbers. To be clear: the image is simply not resampled according to the dpi number, as it should be. The other figure information such as axes, text, colorbar, ... are behaving correctly.
I tried to change the renderer, it did not change anything.
I tested the exact same code on Matlab 2014a and it worked perfectly there: the image resolution followed the selected dpi number. I tested it on another computer and had the same issue with Matlab 2014b.
What is going on? How can I save my figures with the appropriate resolution?

  0 Comments

Sign in to comment.

1 Answer

Answer by spuler
on 10 Apr 2015

I am seeing the same issue. I noticed that the imagesc figures display/load considerably faster in 2014b (and 2015a) compared to 2014a. Possible the resolution problem has something with the with a change to the imagesc call and not print. For now I have to use 2014a to generate high resolution images with the print command.

  0 Comments

Sign in to comment.