6 my $right_name = shift;
8 or die "Usage: $0 left right out\n";
10 my $left = Imager->new(file => $left_name)
11 or die "Cannot read $left_name: ", Imager->errstr, "\n";
13 my $right = Imager->new(file => $right_name)
14 or die "Cannot read $right_name: ", Imager->errstr, "\n";
17 $right = $right->scale;
25 my @delays = ( 50, ( 10 ) x ($steps-1), 50, ( 10 ) x ($steps-1) );
27 for my $pos (1 .. $steps-1) {
28 my $work = $left->copy;
29 $work->compose(src => $right, opacity => $pos/$steps);
33 push @cycle, $right, @down;
36 Imager->write_multi({ file => $out_name, gif_delay => \@delays, gif_loop => 0, make_colors => "mediancut", translate => "errdiff" }, @cycle)
37 or die "Cannot write $out_name: ", Imager->errstr, "\n";
41 wiggle.pl - wiggle stereoscopy
45 perl wiggle.pl left.jpg right.jpg out.gif
49 Produces an animated GIF that displays left, then a blend of four
50 images leading to right then back again. The left and right images
51 are displayed a little longer.
53 If the left and right images form a stereo pair (and the order doesn't
54 really matter) the output animated GIF is useful for wiggle
59 Dan Oppenheim <droppenheim@yahoo.com> described the effect and asked
64 Tony Cook <tonyc@cpan.org>