Sprite encoding/decoding for compact graphics data
|
08-21-2015, 08:43 PM
Post: #3
|
|||
|
|||
RE: Sprite encoding/decoding for compact graphics data
Thank you for your comments.
The solution is rather for game developers. Binary PNG files can be used only in application libraries in HP Prime and not in the 1-file programs in the program catalog, so not everyone uses them. And yes, this encoding is smaller than PNG especially with small color palette, but in some cases may happen exceptions. In general, for more complicated sprite (less compressible) is more worth to use my method. However, smaller sprites provide also greater profit. If someone uses a lot of small sprites the solution is for him. Note that PNG also optimizes the color palette. Simple sprites as those of example EncDecSprite15c consist of four-six colors, but was encoded by me using 15 colors. Using a palette 4 color the final result can be reduced even by half (25 characters per sprite 14x14). The smallest PNG file which I was able to generate the size of 2x2 (4 pixels) of the two colors was the size more than 80 bytes after optimization (take a look at the attachment). At this size of a sprite using my method you can store the sprite size 12x12 of 15 colors or size 6x6 of 16-bit color. In addition, most developers just encodes the graphics data in the source code using integers lists (for using with DIMGROB_P) so there is a lot of completed programs which now can be reduced without major modifications to the source code. A similar method can be used also to encode levels in games like Sokoban Combined with RLE which is used there we can get really interesting results. I hope that it will be useful for someone. BR Piotr |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Sprite encoding/decoding for compact graphics data - komame - 08-20-2015, 04:10 PM
RE: Sprite encoding/decoding for compact graphics data - Han - 08-21-2015, 01:50 PM
RE: Sprite encoding/decoding for compact graphics data - komame - 08-21-2015 08:43 PM
RE: Sprite encoding/decoding for compact graphics data - komame - 08-22-2015, 12:48 PM
RE: Sprite encoding/decoding for compact graphics data - webmasterpdx - 06-25-2017, 02:33 PM
|
User(s) browsing this thread: 1 Guest(s)