save an image in a specific resolution with saveas

82 visualizaciones (últimos 30 días)
Robin Hoja
Robin Hoja el 18 de Mayo de 2022
Comentada: Robin Hoja el 19 de Mayo de 2022
Hello there,
iam trying to safe an figure with saveas(figurename, 'filename','png'), but saving reduces the resolution from 7000x5000 to 1688x1176, and i want to keep the resolution of 7000x5000.
I don't know if I'm too stupid or if it's too obvious...it would be great if someone could help me.

Respuesta aceptada

Image Analyst
Image Analyst el 18 de Mayo de 2022
Don't use saveas() unless you want a screenshot. Even if you do you want a screenshot, should use exportgraphics.
If you want to save the actual image (instead of a figure window rendering of it on your screen) then use imwrite.
  3 comentarios
Image Analyst
Image Analyst el 18 de Mayo de 2022
You're saving the figure handle. That's just as bad. I didn't say to save the figure (screenshot display). I told you to save the actual image variable that gets displayed. You need to save the image variable with imwrite. On the line above
seg_bin, seg_rgb] = createMask(I);
you have 3 images seg_bin, seg_rgb, and I. Which of those images do you want to save to the drive?
imwrite(seg_bin, 'Mask Image.png'); % The binary image
imwrite(seg_rgb, 'Masked RGB image.png'); % The original image blackened outside of the mask.
imwrite(I, 'Original image.png'); % The image that was thresholded, presumably the original image.
Robin Hoja
Robin Hoja el 19 de Mayo de 2022
Thank you, that worked.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Printing and Saving en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by