APNG Generator

A Perl module for generating Animated PNG (APNG) files from individual PNG images.

Quick Start

use Image::APNG;

my $frames =
	[
		['frame1.png', 100],
		['frame2.png', 150],
		['frame3.png', 100]
	];

my $result = Image::APNG::generate($frames);

if ($result->{status} == 0)
	{
	open my $fh, '>', 'animation.png';
	binmode $fh;
	print $fh $result->{data};
	close $fh;
	}

Files

Requirements

Documentation

See APNGGenerator_Documentation.md for complete documentation including:

Key Features

Basic Options

my $options = 
	{
	loop_count           => 0,              # 0 = infinite
	normalize_resolution => 1,     # Make all frames same size
	background_color     => [0, 0, 0, 0], # RGBA
	optimize_palette     => 0,         # Convert to 8-bit
	disposal_method      => 1,          # Frame disposal
	blend_operation      => 1           # Alpha blending
	};

Return Value

{
status => 0,           # 0 = success, 1 = error
errors => [],          # Array of error messages
data   => $binary_data # APNG binary data
}

License

See LICENSE file.

References