Re: [GD-DEVEL] Color bug in JPEG output with 2.0.36

[email protected] (Ethan A Merritt) Sun, 30 Mar 2008 09:50:29 -0800
Newsgroups php.gd.devel
Organization University of Washington
Message-ID <[email protected]>
On Sunday 30 March 2008 08:50, Pierre Joye wrote:
> On Sun, Mar 30, 2008 at 11:48 AM, Pierre Joye <[email protected]> wrote:
> > Hi Ethan!
> > 
> I figured out the source of the "brown" red and posted the explanation in:
> 
> http://sourceforge.net/tracker/index.php?func=detail&aid=1929002&group_id=2055&atid=102055

Right.  However there is still a bit of a mystery.
The following set of commands demonstrates that the quality setting of the
jpeg compression is critical:

  echo "set term png; test" | gnuplot > test.png
  convert -quality 88 test.png test88.jpeg
  convert -quality 90 test.png test90.jpeg

The first conversion shows the red->muddy brown artifact.
The second does not.

However, the gnuplot gd.trm already sets the jpeg quality setting to 90, 
yet the color artifact still occurs.  Is there a difference between what
ImageMagick thinks is "quality 90" and what libgd thinks?

JPEG_text()
{
    int quality = 90;
    image_do_crop();
    if (png_state.flags & PNG_USE_INTERLACE)
        gdImageInterlace(png_state.image, 1);
    gdImageJpeg(png_state.image, gpoutfile, quality);
    gdImageDestroy(png_state.image);
}



-- 
Ethan A Merritt