use GD; my $GDimage = newFromPng GD::Image("imago_temp.png"); my ($width,$height) = $GDimage->getBounds() ; $newimage = GD::Image->new(800,600); $newimage->copyResampled($GDimage,0,0,0,0,800,600 ,$width,$height); open (DISPLAY, ">snapshot.jpg"); binmode DISPLAY; print DISPLAY $newimage->jpeg(100); close (DISPLAY);