MATLAB Answers

0

How to reduce image size before saving into .mat file

Asked by Abdurrehman on 28 Jul 2018
Latest activity Edited by KALYAN ACHARJYA on 30 Jul 2018
I am capturing images from cell phone camera and saving it to .mat file. Due to high resolution .mat file size become high and takes more time when processing on it. How to reduce image size before saving in .mat file so that image should not be more then few kbs without loosing image information. thanks

  3 Comments

What you want is contradictory. You can reduce the size by downsampling with imresize (which will cause a loss of image information), or you can compress the image (which will increase processing time and/or cause a loss of image data).
Without loss of information, size reduction is not possible. It depends on a trade-off between desired size and information loss
Not entirely: it is a trade-off between size, information and processing power. A strong compression will probably require much processing power, which is not what you want if you are on mobile.

Sign in to comment.

1 Answer

Answer by KALYAN ACHARJYA on 28 Jul 2018
Edited by KALYAN ACHARJYA on 28 Jul 2018

imresize(phone_image,scale); %Decide scale as per your requirements.
%Scale-0 to 1, less values means more resize, automaticall size reduce

  3 Comments

Another way, size will reduce-
large_image='image.extension_name';
small_file=rsetwrite(large_image);
%Now do your opertion as per your requiremets
Thanks for the answer, it seems rsetwrite works with .tif only? do we have similar function for .png and .jpg ?

Sign in to comment.