Re: Mystery of the grey scale images.

by "N. Whittley" <nwhittley(at)cinci.rr.com>

 Date:  Sun, 3 Oct 2004 10:53:14 -0400
 To:  <hwg(at)j-a-b.net>,
<hwg-techniques(at)hwg.org>
 References:  cwhvpfkq0q7p91 kontent
  todo: View Thread, Original
Jen,

To tell you the truth I was up till 2:30AM working on this.

IT turned out to be even more simpler than that.

I didnt' have to change the code at all.  I had to make sure the
PNG image is 256 color.  Anything over that and it goes grey.
Since the only image I changed was the case.. that is the one I decreased
to 256 colors, and uploaded it and all the colors came back.

Wow.

Thanks however for the info, I learn new things each day and it
is so much fun.

Thank you, thank you.

Nancy


> On Sun, 3 Oct 2004 01:20:22 -0400, Nancy Whittley <nwhittley(at)cinci.rr.com>
> wrote:
>
> > This one is a mystery to me...
> >
> > The text descriptions are supposed to be
> > grey but the computer cases, and the AMD logos are in color.
> > They should show in color, but they are all grey.
> >
> > Here is the PHP code from one of the systems.
> > http://www.jscustompcs.com/image_code1.txt
> >
> > Can you figure it out?
>
> Hi Nancy,
>
> at first I was quite puzzled as well, but then I took a bath and Heureka!
> the problem boiled down to being too simple to believe:
> The image created is an indexed image because the initial bg.png is
> indexed - but should be truecolor.
> Change the color depth of bg.png to truecolor and all is well.
>
> As an alternative you might as well delete the background image and use
> these lines instead, which will give you more flexibility:
>
> $image      = imagecreatetruecolor(330,250);
> $background = imagecolorallocate($image, 255, 255, 255);
> imagefill($image,0,0,$background);
>
>
> Cheers,
>
> jens
>
> --

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA