The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

ps_evol - Perl script to fine-tune A4 PostScript drawings

SYNOPSIS

 vi plant.ps
 # add comments like:    % evol step 0.05 min 0.0 max 1.0
 ps_evol plant.ps > p2.ps
 ps_evol -k plant.ps > p2.ps   # Keep the intermediate steps
 ps_evol -v        # print the version
 perldoc ps_evol   # read the manual :-)

DESCRIPTION

ps_evol was mainly intended as a demo script illustrating the text_evol funtion in Math::Evol.pm. It assumes you have something like GhostView which allows you to view PostScript files.

It creates a temporary PostScript file, then repeatedly generates eight variants of the original file, scales them smaller, numbers them, and displays them in a 3x3 array. The original is in the middle, as number 5. It asks the user which variant they prefer, then uses that as the original for the next iteration. When the user decides to call a halt, the latest preferred variant is written to the standard output.

The parameters to be varied in the PostScript file must be marked out by special comments, such as

 /gray_sky .87 def % evol step 0.05 min 0.0 max 1.0

See perldoc Math::Evol for more details, and as an example the PostScript file plant.ps, included with the distribution.

OPTIONS

-k

Keeps the intermediate steps of the evolution; they will be named like the source file but with an added number, like plant_001.ps plant_002.ps and so on. This can be useful if you want to make a movie of the evolution process, such as with:

 vi plant.eps
 # it should start with:  %%BoundingBox 0 0 1280 720
 ps_evol -k plant.eps
 for i in plant_*.eps   # you have enough disc, I hope ?
 do
     o=`echo $i | sed 's/eps$/jpg/'`
     gs -sDEVICE=jpeg -sOutputFile=$o -q -g1280x720 $i
 done
 # mencoder insists on consecutive numbers, so if you want to
 # delete one, you have to renumber all the subsequent files :-(
 mencoder -audiofile plantmusic.wav -oac pcm -fps 24 -ofps 24 \
   'mf://plant_*.jpg' -mf h=1280:w=720:fps=24:type=jpeg \
   -o plant.avi -ovc lavc -lavcopts vcodec=mpeg4:aspect=1.7778
 mplayer plant.avi
-v

Prints Version number.

DEPENDENCIES

Uses the CPAN module Term::Clui.pm to dialogue with the user.

AUTHOR

Peter J Billam, www.pjb.com.au/comp/contact.html

CREDITS

Based on Math::Evol.pm, and conceptually on Richard Dawkin's Blind Watchmaker software.

SEE ALSO

Math::Evol.pm, Term::Clui.pm, http://www.pjb.com.au/, perl(1).