Henk actually took Jpeg to its worst case scenario (but as you'll
understand if you read this, it was still fair to do).
I had a bit of involvement with the Jpeg project, years ago. The
concept behind it is to remove data that the human eye is least likely
to miss. It is an complex algorithm. For instance, it tries to leave
areas with high contrasting lines alone (the last things it will "steal
data" from). It looks for areas of color where slight variations exist
or many small random color changes occur. It averages out these pixel
changes. In some ways, it can help remove "noise". It looks at very
dark and light areas to take away pixels, because the human eye is most
sensitive to middle luminosity areas. It also simplifies color before
luma, because although the human eye is more color accurate than luma
sensitive, our eye uses luma to determine definition of form and shape,
and 3 dimensionally.
As some of you might know, for instance, in the video recording field,
products like HQ on your VCR use increased edge definition to create the
illusion of sharper images. A step further is used in the way products
like Super Beta and S-VHS and HI-band 8 mm video work. They increased
the frequency of the luma signal to improve definition there, without
doing much of anything to the chroma (color) signal.
Although our eyes have great color response, the cones are poor for
defining shapes. It is the rods that help us to see shape and form.
This is why animals which require the ability to see fast moving objects
or camouflaged prey often have no color vision (dogs and cats, for
instance). Why waste retinal space with color receptors when more
luminosity receptors would be more advantageous, both in terms of
providing definition and low-light vision. So, the reason dog food is
dyed red even though it might be made of corn meal, if for your benefit,
not for the dog, who could care less if it was green.
Anyway, getting back to the original issue, yes, JPEG compression was
specifically designed for photographic images which contain a large
array of colors and much detail. Also, those are the things that make
these images hard to compress in non-lossey schemes to begin with. By
throwing out some of the less visible pixels, or by averaging them so
that one data term can describe a larger area, a lot of data can be
removed without it being too obvious.
What Henk did in his sample was "unfair" in terms of showing off JPEG's
strong suite, BUT it was fair in proving his point, because it made the
process "transparent" (excuse the pun). This is why you should never
use JPEG compression for line art, or text. There simply is no way to
simplify what is basically a luma only high contrast and edge detailed
image and not have it fall apart under JPEG compression. This is where
TIF and GIF (assuming a under 256 color image) really shine because they
compress by changing the data description of the image without changing
anything. The Photoshop .psd format does something similar.
In a standard "true color" bitmapped image, saved as such, each pixel is
individually described in terms of position, and r,g, and b component.
But imagine if you could describe the image as a matrix of blocks like a
tic-tac-toe board of nine pixels each, and then describe the pixels next
to a "middle square" pixel in terms of that one pixel, by saying, for
instance, the pixel to the left is the same r,g and b, and the one to
the right has the same r and g values, but only the b value differed.
That would save some data needing to be stored in the description. In a
simplified manner, this is what TIF and PSD and other non-lossey methods do.
Anyway, I just know I'm going to be nit-picked to death about my very
simplified descriptions to what are very complex mathematical functions,
but I hope this is somewhat helpful in explaining the differences
between JPEG and other compression methods, and why a photograph shows
less damage by multi-JPEG-ing versus a series of black and white letters.
Art
Alan Tyson wrote:
> No-one has commented on the difference between my results
> a bit of lace jpegged 10 times), posted on 30Mar, and
> Henk's image of a letter on a plain background, similarly
> treated. I can assure folk that I saved each image under a
> new name and only *then* closed it before reloading it.
>
> Is it perhaps that jpeg is specially suited to
> 'photographic' images, and not to areas of single solid
> colours with sharp edges like Henk's image? The latter is
> rare in photographic images, and lossless gif does an
> excellent compression job on that sort of thing anyway.
>
> Would someone who understands the maths of jpeg compression
> care to comment and suggest reasons for the discrepancy,
> please?
>
> Or maybe Henk's and my results need repeating, like cold
> fusion and life on Mars?
>
> Alan T
>
>
> ----- Original Message -----
> From: Hugo Gävert <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, April 02, 2001 12:44 PM
> Subject: Re: filmscanners: File format
>
>
> Come on guys, what happens when you save with jpeg or any
> other
> compression that loses data? You save the file, the
> compression algorithm
> desides what information can be thrown away, and then saves
> it......