Skip to content

cygx/p6-image-png-inflated

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

About

Creates non-compressed PNG images from raw RGBA blobs

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages