Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[WINDOWS+LINUX+ANDROID] PNG2RLE - Create your own kernel boot logo easily

OP alireza7991

25th August 2014, 05:27 PM   |  #1  
alireza7991's Avatar
OP Senior Member
Flag Shahrekord
Thanks Meter: 2,273
 
767 posts
Join Date:Joined: Sep 2012
Donate to Me
More
Screenshot from sources/usage.

About

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:

Code:
./png2rle_linux XYZ.png KMN.rle
*"png2rle_linux" is just in case you are using it on linux. for android it's "png2rle_android" and for windows "png2rle.exe".
*"XYZ.png" is name of the png file and "KMN.rle" is name of output rle file.

Technical Info

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.

Download Mirrors

V1.0 : Linux Windows Android

Licence

Code:
/* 
 * PNG2RLE , standalone cross-platform png to rle converter.
 * Copyright (C) 2014 Alireza Forouzandeh Nezhad <alirezafn@gmx.us> <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.
 *
*/
Special thanks to lodepng library developer which I have used for handling png files.
The Following 17 Users Say Thank You to alireza7991 For This Useful Post: [ View ]
25th August 2014, 05:27 PM   |  #2  
alireza7991's Avatar
OP Senior Member
Flag Shahrekord
Thanks Meter: 2,273
 
767 posts
Join Date:Joined: Sep 2012
Donate to Me
More
reserved.
The Following 5 Users Say Thank You to alireza7991 For This Useful Post: [ View ]
26th August 2014, 07:00 AM   |  #3  
Morningstar's Avatar
Senior Member
Thanks Meter: 148
 
307 posts
Join Date:Joined: Apr 2006
More
Very interesting.....I'll have to play around with this when I get home. Nice work!

○●~astra petas~●○
The Following User Says Thank You to Morningstar For This Useful Post: [ View ]
Post Reply Subscribe to Thread

Tags
kernel, logo, png, rle
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes