jpeg_size

See all posts See thread Reply

Re: jpeg_size new!
by Sofus Comer, 16 years, 9 months ago
There is an explanation to why sizes differ so much when handling JPG compression. The content of an image is based on x times y pixels ofcourse but a jpg compression looks at how a picture is built. Example is if a JPG has a lot of Blue sky or large bodies of very close resembling colour pixels like night snow or any other large body it can thereby resize (ZIP) it much more than a detailed rich picture. In the example of the sky it can go ahead and group the thousands of near blue or cyan pixels and instead of letting each single pixel have its own RGB value (220,200,255) like PSDs, TIFS ect, in can save space by grouping in to Example: 26x(220,200,255), 88x((227,140,255), 4x(220,233,252) etc etc.... Thats why we see some jpgs larger or smaller than others.
Kind regards Sofus Comer, DenmarkReply
Re: jpeg_size new!
by colin, 16 years, 9 months ago
That's right. It is why I use the aforementioned method, in order to estimate the best size. We do three tries, and then use the results to calculate the best compression ratio.

It is only an estimate, and fringe cases may be wrong. But since there is no way to calculate precisely the compression in regard to the size, we attempt to get as close as possible.Reply