0.0
No commit activity in last 3 years
No release in over 3 years
A fast libpng-based compressor for black and white images.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

NL::FastPng

NL::FastPng is a C-based extension that uses libpng in a simplified configuration for faster performance on grayscale images, at the expense of slightly larger file sizes.

This code was used by the Nitrogen Logic Depth Camera Controller to generate PNG images from realtime depth data on limited hardware.

License

NL::FastPng is licensed under a 2-clause BSD license. See the LICENSE file for details. NL::FastPng is © 2011-2020, Mike Bourgeous.

Installation

Add this line to your application's Gemfile:

gem 'nl-fast_png', git: 'git@github.com:nitrogenlogic/nl-fast_png.git'

And then execute:

$ bundle install

Usage

require 'nl/fast_png'

# Store a 2x2 checkerboard pattern to /tmp/x.png
File.write('/tmp/x.png', NL::FastPng.store_png(2, 2, 8, "\xff\x00\x00\xff"))

# Store a 256x256 horizontal gradient to /tmp/grad.png
File.write('/tmp/grad.png', NL::FastPng.store_png(256, 256, 8, 256.times.map(&:chr).join * 256))