Skip to content

hwhw/img2r0ket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

A simple image converter for the r0ket badge written in Go

This little tool converts PBM bitmaps to a byte stream that can be written to the display buffer in the r0ket badge. To learn more about the r0ket badge, see [their homepage] 1. It will work on Linux only for now, I think, since it uses [golzo] 2 for doing (optional) LZO compression. You can use this compression in an [LZO enhanced] 2 r0ket firmware. However, uncompressed output is supported by the basic r0ket firmware as-is.

Installation

I think the software is restricted to Linux for now (liblzo/cgo usage). Note that you need to have Go language support installed.

Then you should be able to just do:

goinstall github.com/hwhw/img2r0ket

Usage

img2r0ket will read from standard input by default and output to standard output. It will accept the following options:

-i specifies an input file

-o specifies an output file

-x will make img2r0ket invert pixel data

-L will make img2r0ket emit compressed output, prepended by a two-byte, lower endian formatted short number that specifies the number of compressed bytes that follow. If this number is 0, then the block could not be compressed and will follow uncompressed in full length.

Examples

Create a single uncompressed image

pngtopnm test.png | pamscale -xyfill 96 68 | ppmtopgm | pnmnorm | pamditherbw | img2r0ket -x > TEST.IMG

This would produce a LZO compressed image stream suitable for "playing" on the r0ket:

mkdir frames
ffmpeg -ss '00:00:41' -vframes 850 -i /somevideo.avi -f image2 -r 12.5 -s 112x68 "frames/%08d.pgm"
ls -1 frames/ | while read f; do \
	cat "frames/$f" | \
	pamcut 8 0 96 68 | \
	pnmnorm | \
	pamditherbw | \
	pamtopnm | \
	img2r0ket -x -L | \
	cat >> LZOTEST.VID;
done
rm -rf frames

Copying/License

The software is free software, licensed under a MIT-style license. See the LICENSE file for the terms.

About

Image converter PBM -> "r0ket" image file format

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages