Baz has asked for the wisdom of the Perl Monks concerning the following question:
Gives -#!C:/Perl/bin/perl -w use strict; #$| = 1; use CGI::Carp "fatalsToBrowser"; use GD; use CGI ":all"; my $im = GD::Image->newFromPng("m.png"); # get the image size my ($width, $height) = $im->getBounds(); my $result; my $index; my $r; my $g; my $b; my $color; for (my $x = 0; $x < $height; $x++) { $result .= "<BR>"; for (my $y = 0; $y < $width; $y++) { $index = $im->getPixel($y, $x); ($r,$g,$b) = $im->rgb($index); $color = sprintf "%02x%02x%02x", $r, $g, $b; $result.= font({color=>"$color"},"."); } } print header; print "$result\n"; print end_html;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: ascii art trouble
by BrowserUk (Patriarch) on Mar 16, 2003 at 07:02 UTC | |
Re: ascii art trouble
by BrowserUk (Patriarch) on Mar 16, 2003 at 12:35 UTC | |
Re: ascii art trouble
by diotalevi (Canon) on Mar 15, 2003 at 23:45 UTC | |
by Baz (Friar) on Mar 16, 2003 at 00:09 UTC | |
by diotalevi (Canon) on Mar 16, 2003 at 00:28 UTC | |
Re: ascii art trouble
by jasonk (Parson) on Mar 15, 2003 at 23:35 UTC | |
by Baz (Friar) on Mar 15, 2003 at 23:42 UTC | |
by jasonk (Parson) on Mar 15, 2003 at 23:54 UTC |