Borrar filtros
Borrar filtros

how to save image

265 visualizaciones (últimos 30 días)
Ahmed
Ahmed el 9 de Dic. de 2011
Comentada: Clinton Connelly el 30 de Sept. de 2021
hai..
how to save image that pop up at frame show figure. I try to used this function,but the saved image not follow the dimension(X x Y) of original image.
saveas(gcf,'mask_image.jpg', 'jpg')
thank

Respuesta aceptada

Jan
Jan el 9 de Dic. de 2011
Image = getframe(gcf);
imwrite(Image.cdata, 'mask_image.jpg');
Another method:
printf(gcf, '-djpeg100', 'mask_image.jpg', '-r0');
But the later is not guaranteed to have exactly the same size. There are some rounding effects between the units of the figure and the pixel resolution.
  2 comentarios
Ahmed
Ahmed el 9 de Dic. de 2011
but..how to save image without is pop up that image in frame show figure.
for example
[image_height,image_width]=size(S);
BW=ones(image_height,image_width);
d=xor(BW,I1);
i want save image "d".
i do like this because i need image "d" in <450x479x3 uint8>.
From coding above I got image "d" in <450x479 logical>.
Clinton Connelly
Clinton Connelly el 30 de Sept. de 2021
You could just use the built-in "imwrite" function to save any loaded image, or specifically a 'uint8' file, to a file of any choice:
Image = imread("ImageName.jpg");
imwrite(Image, "NewImageName.jpg");
This code doesn't return the max resolution of the file, but there is a parameter for that:
Image = imread("ImageName.jpg");
imwrite(Image, "NewImageName.jpg", "Quality", 100)
The interval of values for quality is between 0 and 100, inclusive, with the result being self-explanatory
Other information could be found in matlab by typing the input "help imwrite" and doing some reading...
There's also a text file called libtiffcopyright.txt, but I don't know where to find that

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Language Support en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by