- or download this
for($y=1;$y <= $height;$y++){
for($x=1;$x <= $width;$x++){
- or download this
for my $y ( 0 .. $height - 1 ){
for my $x ( 0 .. $width - 1 ){
- or download this
for my $y ( 1 .. 3 ) {
for my $x ( 1 .. 3 ) {
...
[1:3] => 2
[2:3] => 5
[3:3] => 8
- or download this
my $pixel = ( $y * $width ) + $x;
- or download this
if( $data[ $pixel ] == 0 ){
$image->setPixel( $x, $y, $dbz1 );
...
if ($data[$pixel] > 20 and $data[$pixel] <= 30){
$image->setPixel($x,$y,$dbz15);
}
- or download this
if( $data[ $pixel ] == 0 ){
$image->setPixel( $x, $y, $dbz1 );
...
else {
## What do you want to do if the value is greater than 30?
+?
}
- or download this
open JPEG,'>','test_image.jpg' || die;
print JPEG $image->jpeg();
- or download this
binmode JPEG;
- or download this
#!/usr/bin/perl -w
use strict;
...
print JPEG $image->jpeg();
close JPEG;
exit;