#!/usr/bin/perl use warnings; use Getopt::Long; use Image::Magick; use IO::Handle qw( ); $| = 1; STDOUT->autoflush(1); # Mandatory options: # -f photo jpeg file (full path) GetOptions ( 'f=s' => \$photofile) or die ("can't do getops\n"); #Open the image as an Perlmagick object $ffoto = new Image::Magick; $x = $ffoto->Read($photofile); warn "can't open photofile:$x" if "$x"; $ffoto->Resize(geometry=>'x296'); $ffoto->Set(depth=>8); $ffoto->Rotate(degrees=>270); $ffoto->Negate(); $ffoto->Evaluate(value=>8, operator=>'Divide'); #Copy image to new image objects $yellow = $ffoto->Clone(); #Separate the colours - need to set depth again $yellow->Separate(channel=>'yellow'); $yellow->Set(depth=>8); ## ## EPCL output section ## #yellow: binmode STDOUT; $yellow->Write('gray:-'); print ("\r"); print ("\x1bIS 0\r"); #DEBUG print ("should be last line\n"); exit 0;