ps_evol - Perl script to fine-tune A4 PostScript drawings


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


ps_evol was mainly intended as a demo script illustrating the text_evol funtion in 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, included with the distribution.



Keeps the intermediate steps of the evolution; they will be named like the source file but with an added number, like 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 ?
     o=`echo $i | sed 's/eps$/jpg/'`
     gs -sDEVICE=jpeg -sOutputFile=$o -q -g1280x720 $i
 # 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

Prints Version number.


Uses the CPAN module to dialogue with the user.


Peter J Billam,


Based on, and conceptually on Richard Dawkin's Blind Watchmaker software.

SEE ALSO,,, perl(1).