r.joseph has asked for the wisdom of the Perl Monks concerning the following question:
Running the above script, color pallete becomes GREATLY reduced, even though the image format stayed the same (PNG all the way through). The same happened if the calls to $gdimg->colorAllocate() and $gdimg->string() are completely removed, so that basically all that is happening is a read/write of the file through the GD interface. Printing out $gdimg->colorsTotal() returns only 256. As an example, check out these two images:use GD; # read the image my $gdimg = GD::Image->newFromPng("my_image.png"); # we need a color for our text my $green = $gdimg->colorAllocate(0,255,0); # write the string "TEST!" to the image $gdimg->string(gdMediumBoldFont, 5, 5, "TEST!", $green); # get the new image my $data = $gdimg->png; # write it out binmode STDOUT; print $data;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: GD reducing pallete causes major problems.
by LTjake (Prior) on Aug 10, 2002 at 13:36 UTC | |
Re: GD reducing pallete causes major problems.
by Albannach (Monsignor) on Aug 10, 2002 at 18:25 UTC | |
by hossman (Prior) on Aug 11, 2002 at 00:16 UTC | |
by hossman (Prior) on Aug 11, 2002 at 19:17 UTC | |
by r.joseph (Hermit) on Aug 10, 2002 at 22:58 UTC | |
by r.joseph (Hermit) on Aug 10, 2002 at 23:05 UTC | |
Re: GD reducing pallete causes major problems.
by hossman (Prior) on Aug 15, 2002 at 17:41 UTC |