this is a simple "rescale to 256x256" program. (there
are too many "use" statements here - this was cut from a
larger program).
#! /bin/perl
use PDL;
use PDL::FFT;
use PDL::IO::Pic;
use PDL::Image2D;
use PDL::ImageRGB;
use PDL::ImageND;
use PDL::Primitive;
use PDL::Slices;
$real = PDL->rpic('image.pgm'); # read image
$display = zeroes(256,256); # new empty image
PDL::rescale2d($real, $display); # scale into empty image
$display->wpic("test.tif"); # done
update:Zaxo: PDL::IO::Pic takes care of image headers, compression, etc. for you.