Views
665
Replies
5
Status
Closed
Hi all!
I’ve read that there’s no defined compression level scale in the JPEG specification itself. Is there any alternative way to detect the compression level technically?
Even on Wiki, they subtitle three images (the horse) as 10%, 50% and 100%:
http://en.wikipedia.org/wiki/JPEG
But % of what???
I need a somewhat reliable algorithm/formula to check all sorts of JPEG images coming from ***any*** unknown compressor (Photoshop, GIMP, …). I need to reject certain images whose compression level (obviously) is too low.
I could think of a simple relation, like:
Compressed file size
———————- >= X
Uncompressed file size
If an image fails to meet that compression criterion, it is rejected.
I’m not much into JPEG compression, but I presume the dangerous thing about this formula is that this ratio can get pretty small with images having large areas of similar/same colors (like sky on a background).
Consequently, it would be better to have this formula:
Compressed file size
————————————- >= X
Maximum quality compressed file size
Like this, the image’s relative upper bound is taken for comparison – a better approach I might think. But, is there a defined "maximum quality compression level" in JPEG, that I can rely on?
If not, I’m out of luck. The best would probably be to have a human look at each image and decide. But that’s something I want to avoid or minimize.
Any advice is appreciated on this issue!
Karsten
PS: Sorry for xpost 2 so many groups
I’ve read that there’s no defined compression level scale in the JPEG specification itself. Is there any alternative way to detect the compression level technically?
Even on Wiki, they subtitle three images (the horse) as 10%, 50% and 100%:
http://en.wikipedia.org/wiki/JPEG
But % of what???
I need a somewhat reliable algorithm/formula to check all sorts of JPEG images coming from ***any*** unknown compressor (Photoshop, GIMP, …). I need to reject certain images whose compression level (obviously) is too low.
I could think of a simple relation, like:
Compressed file size
———————- >= X
Uncompressed file size
If an image fails to meet that compression criterion, it is rejected.
I’m not much into JPEG compression, but I presume the dangerous thing about this formula is that this ratio can get pretty small with images having large areas of similar/same colors (like sky on a background).
Consequently, it would be better to have this formula:
Compressed file size
————————————- >= X
Maximum quality compressed file size
Like this, the image’s relative upper bound is taken for comparison – a better approach I might think. But, is there a defined "maximum quality compression level" in JPEG, that I can rely on?
If not, I’m out of luck. The best would probably be to have a human look at each image and decide. But that’s something I want to avoid or minimize.
Any advice is appreciated on this issue!
Karsten
PS: Sorry for xpost 2 so many groups
Related Tags
How to Improve Photoshop Performance
Learn how to optimize Photoshop for maximum speed, troubleshoot common issues, and keep your projects organized so that you can work faster than ever before!