convert png image data into an lcd compatible framebuffer
npm install png-to-lcd!'npm version' !'downloads over month'
png-to-lcd
==========
Convert a PNG image into an LCD/OLED compatible framebuffer
javascript
npm install png-to-lcd
`What does it do?
png-to-lcd consumes a PNG image file, and returns the image data, formatted for OLED screens (an 8-bit/byte framebuffer). It's just monochrome support for now. It only supports SSD1306 OLED displays. You can buy these pretty cheaply on Adafruit (my favourite), Sparkfun, eBay, and sites like Banggood. What doesn't it do?
Image prep - the image you pass in should be an RGBA PNG (both colour and greytone are acceptable), and sized to the exact dimensions of the screen you'd like to use. So if your screen is 128x64 pixels, size it so in your image editor of choice. I suggest Pixelmator, Acorn, or GIMP if you're into desktop software. Alternatively, if you're into super awesome software made in the browser by a badass, try Jenn Schiffer's noice make8bitart.com, which is really quite suitable for this kind of low res screen design.
Usage
png-to-lcd takes three arguments:_string_ filename - this is pretty obvious really.
_bool_ dither - do you want to run a dithering algorithm on your image?
_function_ callback - callback when image formatting complete
Example
`javascript
var pngtolcd = require('png-to-lcd');pngtolcd('cat.png', true, function(err, buffer) {
console.log(buffer.toString('hex'));
});
``png-to-lcd uses the Floyd Steinberg algorithm specifically, as it produces the clearest images on a pixel screen in my experience.
Dithered 128 x 32 display example:
!cat 128x32
Dithered 128 x 64 display example:
!cat 128x32
Non dithered 128 x 32 display text example:
!noopkat
For non dithered pics - try nudging the pixels using just black and white only (no grey) in your image editor for best results before running it through this module.