Creating .PNG image from temperature values

Illustration
Merrick - 2020-10-30T09:58:44+00:00
Question: Creating .PNG image from temperature values

The size of my table (i.e. variables) is 462x622 double I used the code below to create an image: imagesc(image); colormap jet; axis off However, the pixel size of the resulting image is 420x560. How can I make an image with the same pixel size as the variables?  

Expert Answer

Profile picture of John Michell John Michell answered . 2025-11-20

I guess you are using saveas() or some other function to save the .webp file. They are not suitable for maintaining the resolution. Use imwrite() as shows in the following lines

image = round(rescale(image, 1, 256));
imwrite(image, jet, 'image.webp');


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!