Why not just draw a big filled rectangle, the size of your image, in white, before you start drawing anything else? Use the filledRectangle method. There may be a more clever way of doing it, but that's how I've solved this king of thing in the past!
s^^unp(;75N=&9I<V@`ack(u,^;s|\(.+\`|"$`$'\"$&\"\)"|ee;/m.+h/&&print$&
| [reply] [d/l] [select] |
From the GD documentation:
$index = $image->colorAllocate(red,green,blue)
This allocates a color with the specified red, green and blue components and returns its index in the color table, if specified. The first color allocated in this way becomes the image's background color. (255,255,255) is white (all pixels on). (0,0,0) is black (all pixels off). (255,0,0) is fully saturated red. (127,127,127) is 50% gray. You can find plenty of examples in /usr/X11/lib/X11/rgb.txt.
(emphasis is mine)
So, before your loop do:
$im->colorAllocate(255,255,255);
<-radiant.matrix->
Larry Wall is Yoda: there is no try{} (ok, except in Perl6; way to ruin a joke, Larry! ;P)
The Code that can be seen is not the true Code
"In any sufficiently large group of people, most are idiots" - Kaa's Law
| [reply] [d/l] |