elsif has asked for the wisdom of the Perl Monks concerning the following question:

My script is here: http://euphoria.arealisp.com/~utonium/RBS/sample.txt

Background graphics are in the same directory as rbs-blue.png, rbs-bronze.png, rbs-silver.png, rbs-gold.png.

My sample result are here: http://euphoria.arealisp.com/RBS/allgraphics.html

Despite all of my stringFT's being done in a loop, always using the same variable ($black), the graphs generate text in white and green.

So I went added code form my beta attempt which used string and gdGiantFont instead. On the first 2 examples, the text takes on the color of the border of the original background image. In the next two, the text white and blue make an appearance.

Blue. Seriously.

I've tried swapping the place of my $black and $white declarations with no results. I read somewhere that the first colorAllocate is perhaps used as a background and then future text of that color is transparent...

When I comment out my declaration of $black, text on 3 of the 4 possible background/original images turns to black. On the odd one, the text becomes white.

What am I doing wrong here?

I should add that no matter what RBG combo I specify for $black, I get the same results.

  • Comment on Creating PNG's using GD from an existing PNG...issues with colors

Replies are listed 'Best First'.
Re: Creating PNG's using GD from an existing PNG...issues with colors
by BrowserUk (Patriarch) on Aug 27, 2009 at 01:52 UTC
    What am I doing wrong here?

    Firstly, you are failing to meet the fairly rudimentary requirements of posting at Perlmonks.

    1. Failing to use the simple formating markup required by the site. (Hint:<pre></pre> tags are verbotten!)
    2. Why post your code offsite rather than here? What sense will your post and any answers have when your offsite code is no longer available?

    The probable cause of your problem is that you are trying to use palletised colors (8-bit) on a truecolor (24-bit) image.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      Sorry, I suck. Will post appropriately in the future. In any case, yes, truecolor is what did the trick. Thanks, -Jake

        In the interest of improving the site, what would have caught your attention enough that you would have noticed that pre tags were bad here?


        True laziness is hard work