Raku Land

Image::PNG::Inflated

github:cygx

Image::PNG::Inflated build status

Creates PNG images from raw RGBA data of depth 8, chunking the data into non-compressed 64k blocks.

Synopsis

use Image::PNG::Inflated;
use Image::RGBA::Fun;

# grayscale gradient
my $grad = blob8.new(map { |($_, $_, $_, 255) }, ^256);
my $blob = [~] $grad xx 64;             # ^--- a opaque pixel

spurt 'grayscale.png', to-png($blob, 256, 64);
                            # width --^    ^-- height

# our most beloved butterfly
my $img = load-rgba-from-textfile('camelia.txt');
spurt 'camelia.png', to-png($img);

The only exported symbol is the &to-png subroutine

sub to-png($img, $w = $img.width, $h = $img.height) { ... }

If the $img argument is not of type blob8 itself, such an object must be returned from the call $img.blob8.

Bugs and Development

Development happens at GitHub. If you found a bug or have a feature request, use the issue tracker over there.

Copyright (C) 2015, 2017, 2019 by cygx <cygx@cpan.org>

Distributed under the Boost Software License, Version 1.0