Friday, January 13, 2012

Image Compression in GNU Octave and Matlab

Suppose you have an image file namely "image.jpg". Due to the file size, you want to compress it to smaller size. In GNU Octave and Matlab, the following simple commands can be used,
image=imread('image.jpg');

imwrite(image,'image_new.jpg','quality',50);
Those commands will compress "image.jpg" to "image_new.jpg" with the quality of compressed image is 50% of the original image.Please note, the current supported image format. when I wrote this article, is .jpg only.

Related Posts Plugin for WordPress, Blogger...