NAME
Image::APNG - Generate Animated PNG (APNG) files from individual PNG images
SYNOPSIS
use Image::APNG;
my $frames =
[
['frame1.png', 100],
['frame2.png', 150],
['frame3.png', 100]
] ;
my $options =
{
loop_count => 0,
normalize_resolution => 1,
background_color => [255, 255, 255, 0]
} ;
my $result = Image::APNG::generate($frames, $options) ;
if ($result->{status} == 0)
{
open my $fh, '>', 'output.png' ;
binmode $fh ;
print $fh $result->{data} ;
close $fh ;
}
else
{
print "Errors: " . join("\n", @{$result->{errors}}) ;
}
DESCRIPTION
Generates APNG files from a list of PNG images with individual frame delays.
OPTIONS
- optimize_palette
-
Boolean. Convert frames to 8-bit indexed PNG. Default: 0
- normalize_resolution
-
Boolean. Make all frames the same resolution. Default: 0
- target_resolution
-
Array reference [width, height]. Override automatic resolution. Default: undef
- background_color
-
Array reference [R, G, B, A] (0-255). Background for smaller frames. Default: [0, 0, 0, 0]
- loop_count
-
Integer. Animation loops (0 = infinite). Default: 0
- disposal_method
-
Integer (0-2). Frame disposal method. Default: 1
- blend_operation
-
Integer (0-1). Frame blending operation. Default: 1
RETURN VALUE
Hash reference with keys:
- status
-
0 for success, 1 for error
- errors
-
Array reference of error messages
- data
-
Binary APNG data (undef on error)
AUTHOR
Generated for APNG creation