image compression should bitmap image?
2 views (last 30 days)
Show older comments
haii, I want to ask whether the image should be compressed bitmap format? because when I perform image compression with format PNG and JPEG formats generated ratio does not correspond to my formula the ratio = original image size / image compress. But if the ideal format png / jpeg fox was my first to the bitmap with Photoshop, the ratio produced in accordance with my formula.
0 Comments
Answers (1)
Walter Roberson
on 12 Jan 2017
No. It is just that image compression ratio is not meaningful when you compare the image files. Image files are container formats that can include all kinds of extra information such as copyright, date taken, focal length, comments, pixel resolution, preview images. You could potentially have compressed the image portion of the file by a factor of 100 and yet end up with a larger file, if the writing of the container adds in more information than was there before.
In short, comparing the directory bytes information about two image files does not tell you anything reliable about the image compression ratios of the images stored in image files.
3 Comments
Image Analyst
on 13 Jan 2017
Use imwrite() to save arrays in an image format. Don't use save(), which saves it in a MATLAB proprietary format. What you're saving is a structure in a proprietary format, not an image that's been compressed and saved to an image file in JPG format.
Walter Roberson
on 13 Jan 2017
See Also
Categories
Find more on Image Segmentation and Analysis in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!