13ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#!/usr/bin/perl
23ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
33ed852eea50f9d4cd633efb8c2b054b8e33c253cristyuse Image::Magick;
43ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
53ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#$font = '-adobe-helvetica-medium-r-normal--25-180-100-100-p-130-iso8729-1';
63ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#$font = 'Times';
73ed852eea50f9d4cd633efb8c2b054b8e33c253cristy$font = 'Generic.ttf';
83ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
93ed852eea50f9d4cd633efb8c2b054b8e33c253cristy$image = Image::Magick->new();
103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy$smile = Image::Magick->new();
113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy$smile->Read('smile.gif');
123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy$smile->Set(background=>'none');
133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy$x = 100;
143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy$y = 100;
153ed852eea50f9d4cd633efb8c2b054b8e33c253cristyfor ($angle=0; $angle < 360; $angle+=30)
163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  my ($thumbnail);
183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  print "angle $angle\n";
203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  $thumbnail=Image::Magick->new(size=>"600x600",pointsize=>24,font=>$font,
213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    fill=>'black');
223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  $thumbnail->Read("xc:white");
233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  $thumbnail->Draw(primitive=>'line',points=>"300,100 300,500",stroke=>'#600');
243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  $thumbnail->Draw(primitive=>'line',points=>"100,300 500,300",stroke=>'#600');
253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  $thumbnail->Draw(primitive=>'rectangle',points=>"100,100 500,500",
263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    fill=>'none',stroke=>'#600');
273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  $thumbnail->Composite(image=>$smile,gravity=>"NorthWest",x=>$x,y=>$y,
283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    rotate=>$angle);
293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  $thumbnail->Composite(image=>$smile,gravity=>"North",y=>$y,rotate=>$angle);
303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  $thumbnail->Composite(image=>$smile,gravity=>"NorthEast",x=>$x,y=>$y,
313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    rotate=>$angle);
323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  $thumbnail->Composite(image=>$smile,gravity=>"West",x=>$x,rotate=>$angle);
333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  $thumbnail->Composite(image=>$smile,gravity=>"Center",rotate=>$angle);
343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  $thumbnail->Composite(image=>$smile,gravity=>"East",x=>$x,rotate=>$angle);
353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  $thumbnail->Composite(image=>$smile,gravity=>"SouthWest",x=>$x,y=>$y,
363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    rotate=>$angle);
373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  $thumbnail->Composite(image=>$smile,gravity=>"South",y=>$y,rotate=>$angle);
383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  $thumbnail->Composite(image=>$smile,gravity=>"SouthEast",x=>$x,y=>$y,
393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    rotate=>$angle);
403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  push(@$image,$thumbnail);
413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy$image->Set(delay=>20);
433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy$image->Write("composite.miff");
443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy$image->Animate();
45