#!/usr/bin/perl use warnings; use strict; use Image::Magick; if (@ARGV != 1) { print "usage: generate_images \n"; exit; } open FILE, $ARGV[0] or die $!; while () { while ( /(['\w-]*)/g ) { my $image=Image::Magick->new(size=>'350x450'); $image->ReadImage('xc:black'); $image->Annotate(font=>'kai.ttf', pointsize=>40, gravity=>'Center', fill=>'yellow', text=>$1); $image->Write(filename=>"$1.png", compression=>'None'); } } close FILE;