alanonymous has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl #use strict; use GD; $width = 800; $height = 600; $outpizzle = new GD::Image($width,$height); #$outpizzle->interlaced('true'); #define a $%!@ ton of colors ... bad idea? for ($i=0; $i<10; $i++) { for ($j=0; $j<10; $j++) { for ($k=0; $k<10; $k++) { $colors[$i][$j][$k] = $outpizzle->colorAllocate($i*25,$j*2 +5,$k*25); } } } #draw some shizzle for ($i=0; $i<$width; $i++) { for ($j=0; $j<$height; $j++) { $outpizzle->setPixel($i,$j,$colors[int(10*($i/$width))][int(10 +*($j/$height))][0]); #print int(10*($i/$width))+"\n"; } } #output the picture open(PICTURE, ">picture.png") or die("uh oh spaghettio"); binmode PICTURE; print PICTURE $outpizzle->png; close PICTURE;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Image Editing with GD
by BrowserUk (Patriarch) on Nov 10, 2006 at 12:13 UTC | |
by alanonymous (Sexton) on Nov 10, 2006 at 12:36 UTC | |
by BrowserUk (Patriarch) on Nov 10, 2006 at 13:36 UTC | |
by alanonymous (Sexton) on Nov 11, 2006 at 00:27 UTC | |
by Melly (Chaplain) on Nov 10, 2006 at 13:06 UTC |