PNG2RLE is a cross-platform tool which convert png images to rle image. RLE image format is used by some devices as kernel logo format because it's fast and provides a pretty good compression. There are some similar scripts but they are neither cross-platform nor standalone and they need to ImageMagick (which png2rle does not). This has made png2rle be the easiest to use one.
Since it's cross-platform you can use it on a windows machine, a linux one or even run it on your Android device!
The project is open source, Sources are here : https://github.com/alireza7991/png2rle
How to use
It's pretty straghtforward. Just get binaries for your OS, put there some where, put you png file there as well and open terminal/command line:
./png2rle_linux XYZ.png KMN.rle
*"XYZ.png" is name of the png file and "KMN.rle" is name of output rle file.
about RLE compression: format uses a simple compression method, use 2 cells for each pixel, one stores pixel info and second one stores number of repeats of pixel. so if we have 10000 black pixel in a line, it will be a pixel with 10000 repeats.
about RLE pixel format: Unlike PNG, RLE uses 16bits pixels, this means there is 5 bits for red, 6 for green and 5 for blue. no alpha is implemented. this makes RLE pixels be 50% smaller than RBGA pixels in PNG.
How PNG is converted to RLE:
Since these two format use completely different compression and pixel format, we have to first convert PNG to raw rgba8888 pixels, then it should be converted to rgb888 and finally a hybrid converter converts it to rle565 (converting to both rgb565 and rle565 at same time).
More details about how I could convert png to rle is available in the main.c file in sources.
V1.0 : Linux Windows Android
/* * PNG2RLE , standalone cross-platform png to rle converter. * Copyright (C) 2014 Alireza Forouzandeh Nezhad <[email protected]> <http://alirezafn.net> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */