This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > Computer Graphics with Photoshop > December 2004 > Detecting JPEG compression?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Detecting JPEG compression?
|
|
| Karsten Wutzke 2004-12-23, 7:14 pm |
| 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
| |
| Peadge 2004-12-23, 11:14 pm |
|
"Karsten Wutzke" <kwutzke-blahblah@emporis.com> wrote in message
news:cqf1ka$52k$03$1@news.t-online.com...
> 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
>
JPEG compression is mostly used to balance file size with image quality. In
Photoshop, there is a little slider that allows the user to select the level
of compression. Format Options like Baseline Standard, Baseline Optimized
and Progressive offer even more tweaking.
In Photoshop's "Save for Web" panel, you can actually compare visually up to
3 versions of the image, each with different levels of compression, with the
original to determine both the (acceptable) quality and resulting file size.
Depending on the complexity of the image, some files can be greatly
compressed with very little loss in quality.
I'm not sure if there is any way to tell what level of compression has been
applied to an image saved as a JPEG, especially considering that one can
compress a JPEG, save it, close the file, open it back up, and compress it
again. This practice is NOT RECOMMENDED! Plus, it seems you would need to
know the original uncompressed value to even make the determination (first
equation). And what file type would you use to determine this uncompressed
value?
This link may explain more about your specific concern:
http://www.faqs.org/faqs/jpeg-faq/part1/
Quoted from the above site:
"Thus, JPEG is intended for compressing images that will be looked at by
humans. If you plan to machine-analyze your images, the small errors
introduced by JPEG may be a problem for you, even if they are invisible to
the eye."
Happy Holidays!
Peadge :-)
| |
|
| On Thu, 23 Dec 2004 18:33:22 -0800, "Peadge" <oneravenlunatic@comcast.net>
wrote:
>I'm not sure if there is any way to tell what level of compression has been
>applied to an image saved as a JPEG, especially considering that one can
>compress a JPEG, save it, close the file, open it back up, and compress it
>again. This practice is NOT RECOMMENDED! Plus, it seems you would need to
>know the original uncompressed value to even make the determination (first
>equation). And what file type would you use to determine this uncompressed
>value?
jpgQ - JPEG Quality Estimator
http://www.mediachance.com/digicam/jpgq.htm
How this all works?
Very simple - Load any JPG and press RUN! button.
The software will do some calculating and then display
the values it estimates.
Standard JPEG
Value here apply to most JPEG images.
This is adjusted to the standard 2-1-1 subsampling.
/CoMa
| |
| Peadge 2004-12-24, 12:14 pm |
|
"CoMa" <hubbabub-nys@algonet.se> wrote in message
news:bspns0h1cu9m9ro50q038qqeg6ov1mfra0@4ax.com...
> On Thu, 23 Dec 2004 18:33:22 -0800, "Peadge" <oneravenlunatic@comcast.net>
> wrote:
>
been[color=darkred]
it[color=darkred]
(first[color=darkred]
uncompressed[color=darkred]
>
>
> jpgQ - JPEG Quality Estimator
> http://www.mediachance.com/digicam/jpgq.htm
>
> How this all works?
> Very simple - Load any JPG and press RUN! button.
> The software will do some calculating and then display
> the values it estimates.
>
> Standard JPEG
> Value here apply to most JPEG images.
> This is adjusted to the standard 2-1-1 subsampling.
>
>
>
> /CoMa
>
Very interesting! I wonder if this tool will show up in an episode of the
upcoming season of CSI!
Peadge :-)
| |
|
| HeHeHeHeHe ...
Probably scheduled for CSI:Miami in late-March ...
HeHeHeHeHe ...
;-))
| |
| Gadgets 2004-12-27, 4:14 am |
| Size isn't everything! Have to take into account embedded profile, EXIF,
thumbnail and other crap... If you knew they were processed with something
like Save For Web, then perhaps image dimensions vs file size would be
useful?
Cheers, Jason
Photo folio:
http://gadgetaus.com/photos
| |
|
| HeHeHeHeHe ...
Probably scheduled for CSI:Miami in late-March ...
HeHeHeHeHe ...
;-))
|
|
|
| | Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |
|