image compression should bitmap image?

2 次查看(过去 30 天)
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.

回答(1 个)

Walter Roberson
Walter Roberson 2017-1-12
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 个评论
Image Analyst
Image Analyst 2017-1-13
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.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Image Segmentation and Analysis 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by