Run-length encoding for graphics files

Discuss game and other programming topics not specifically covered in another forum

Moderator: Programming Moderators

User avatar
Pgartside
Posts: 58
Joined: Tue May 30, 2017 2:56 am

Run-length encoding for graphics files

Postby Pgartside » Fri Jun 08, 2018 11:30 am

If you want to compress your graphics files for loading from sd card on the Next I have a little app to run-length encode them.
It compresses all the 0xe3, the transparent areas of the graphics.

To uncompress the graphics:

If byte=0xe3 the next byte is the length-1 so 0=1 and 255=256 so fill memory with 0xe3 for length+1
If byte!=0xe3 just copy the byte to memory

Some of my test on my graphics got me a %50 saving on card space.

It's written in C# and I've included the .exe for windows users and include the .cs so people can compile it for other platforms.
Attachments
Run-lengthEncodeE3.zip
(3.57 KiB) Downloaded 38 times

Who is online

Users browsing this forum: No registered users and 1 guest