News:

11 March 2016 - Forum Rules

Main Menu

Compression

Started by rainbwsprinklez, May 18, 2020, 11:22:15 AM

Previous topic - Next topic

rainbwsprinklez

I'm looking far into the future, but I am interested in compressing a SNES image file...  I work with bytes. How can I make 32 bytes (a SNES Tile) be equal to 16 bytes?
Anything is possible :)

nesrocks

Image compression depends a lot on the type of image (or any data really) you're trying to compress. If it's a fuzzy completely random image it might not be very compressible at all, but if the entire image is all a single flat color then it will be highly compressible.

Bregalad

Quote from: rainbwsprinklez on May 18, 2020, 11:22:15 AM
I'm looking far into the future, but I am interested in compressing a SNES image file...  I work with bytes. How can I make 32 bytes (a SNES Tile) be equal to 16 bytes?
If you want a fixed compression rate like that, the easiest would be to work with 2BP tiles, so that each tile is 16 bytes. This can be done either by using the appropriate screen mode/BG layer, or by extending tiles on the fly from 2BP to 4BP by software, the latter option still use 32-bytes per tile in VRAM though.

If you're aiming at lossless compression of 4BP tiles, you're never going to have a fixed ratio like you mention, and various algorithms exist, any general purpose compression algorithm will work but many of those can be optimized to work better with tile graphics somehow.