Video-Kaleidoscope

Video::Kaleidoscope takes a list of colours and a seed and makes a short
video of a kaleidoscope: outlined and shaded shapes in those colours on a
plane that slides and rocks beneath mirrors, and comes back at the end to
where it began, so that the video loops with no join.

    kaleidoscope --seed tulip --out tulip.mp4 ff0044 ffd400 0b3d91

The program says what the seed chose, plays the loop in the terminal as
well as the terminal can show it, and writes the video: H.264 in an MP4
file, 1080 pixels a side, 30 frames a second, 10 seconds.

    use Video::Kaleidoscope qw(kaleidoscope);

    my $k = kaleidoscope(colours => [ '#ff0044', '#ffd400', '#0b3d91' ],
                         seed    => 'tulip');
    my $rgba = $k->frame(0);
    my $made = $k->write('tulip.mp4');
    my $held = $k->mirrors_hold(0);
    my $read = $k->decodes('tulip.mp4');

Many seeds can be chained into one video. Each plays for its own length
and blends into the next, and the last blends into the first:

    kaleidoscope --seed tulip --seed amber --seed glass --seconds 8,5,10 \
                 --blend 2 --out chain.mp4 ff0044 ffd400 0b3d91

    my $k = kaleidoscope(colours => \@colours, blend => 2,
                         seeds   => [ [ 'tulip', 8 ], [ 'amber', 5 ], [ 'glass', 10 ] ]);

The seed chooses how the mirrors are arranged, how many shapes there are,
what each is and how it moves. The same colours, the same seed and the same
settings give the same video, byte for byte, on every machine and on every
day.

Two checks are part of the module. The first holds that every pixel of a
frame is the colour of its image in every mirror, with nothing allowed for
rounding. The second reads a written file back and holds every frame of it
to the frame drawn again.

INSTALLATION

To install this module, run the following commands:

	perl Makefile.PL
	make
	make test
	make install

It needs Video::Frames and Ex::Op to run, and ExtUtils::Configure to
configure.

SUPPORT AND DOCUMENTATION

After installing, you can find documentation for this module with the
perldoc command.

    perldoc Video::Kaleidoscope
    perldoc kaleidoscope

You can also look for information at:

    RT, CPAN's request tracker (report bugs here)
        https://rt.cpan.org/NoAuth/Bugs.html?Dist=Video-Kaleidoscope

    Search CPAN
        https://metacpan.org/release/Video-Kaleidoscope


LICENSE AND COPYRIGHT

This software is Copyright (c) 2026 by LNATION <email@lnation.org>.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)

