[Magick-bugs] Quality degradation in JPEG conversions
Glenn Randers-Pehrson
glennrp at comcast.net
Sat May 26 11:11:05 PDT 2007
At 08:00 PM 5/26/2007 +0300, Tuure Laurinolli wrote:
>Glenn Randers-Pehrson wrote:
>> At 06:03 PM 5/26/2007 +0300, Tuure Laurinolli wrote:
>>> I have noticed that various conversions to and from JPEG express strange
>>> quality degradations. JPEG -> JPEG and JPEG -> PNG ->JPEG conversions
>>> compared to JPEG -> PNM -> JPEG often appear blocky, especially on the
>>> red channel.
>>>
>>> When comparing jpeg-jpeg and jpeg-png-jpeg conversions, the result look
>>> very similar - especially the blockiness of the text on the backdrop. In
>>> comparison, the text is crisp and clear in jpeg-pnm-jpeg conversion. I
>>> wonder what causes the difference.
>>>
>>> Files can be found in:
>>> http://fop3.kyla.fi/~tazle/imagemagick-bug/
>>
>> Try "identify -verbose -debug coder -log %e jpeg-pnm-jpeg.jpg", etc,
>> and look for differences in sampling factors. The jpeg-pnm-jpg has
>> a larger filesize than the others.
>
>Indeed they are different. jpeg-jpeg and jpeg-png-jpeg have 2x2, 1x1, 1x
>1 sampling factors whereas jpeg-pnm-jpeg has 1x1, 1x1, 1x1 sampling
>factors. I would guess these refer to RGB channels, since red seems to
>be taking the hit here.
They refer to Y, U, and V channels.
>I wonder why the sampling factors depend in input image format.
I don't know. But you can use the -sampling-factor option to
force them to be what you want.
Glenn
More information about the Magick-bugs
mailing list