how to save size when saving a matlab figure

2 views (last 30 days)
david
david on 6 Jan 2014
Commented: david on 8 Jan 2014
hi
i have a gray scale matix size 640X480. i used a imshow() command and i get the image om matlab window 640X480. but when i'm try to save the image (as a jpeg or other format) i get a different size of image..
what do i need to do to save the image the same size as the matrix (640X480)?

Answers (1)

Image Analyst
Image Analyst on 6 Jan 2014
You don't. You get the same size laterally (# of rows & columns). If you think you don't then prove it with a small script to demonstrate that. Be aware that the size on the disk may not be the same number of bytes as 640 times 480 because of compression that may take place plus the addition of header information.
  1 Comment
david
david on 8 Jan 2014
im new in the matlab world...
i have a jpeg file (test) that have a color image size 640X480 i convert the file to a gray scale image:
SrcIm=rgb2gray(imread('test.jpg'));
after this command i get a 640X480 matrix, after i do this command
imshow(SrcIm);
and i get a figure matlab window with an image size 640X480 (as i want) but when i tried to save the image (file->save as..) any format i try i get a diffrent image size (not 640X480 as i want)..
what im doing wrong? how can i save the image as the original size(640X480)?
thanks

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!