Play-Pic-2-Map V0.04 - Double Packing Pictures
Ok, so what these types of programs do, is they compress the original source image by removing any redundant repetitive parts, leaving us with the unique parts and the data on how the blocks are to be reassembled, to recreate the original picture. Now the thing is, even though your picture might be laid out on a 32x by 32y grid, this may not be the most efficient size for the blocks, as sections of the unique blocks may indeed repeat also.
So what you can do, is re-compress the 32 by 32 unique blocks down into a smaller sizes (eg half/quarter). Now for the sake of an example, i took the Castle Map
and converted that into a 32 by32 block map with level map. In raw terms, we're converting the 25 meg
(512x * 12256y * 4 byte ) level image and compressing it down to approximately 430K
total. Now this process creates a unique block map image that's 320x*320y, which is the bulk of the 430k, but rather than keep this block image, we then pass it back through Pic-2-Map again. This time using a block size of 8 By 8 to further reduce, which spits out a 178x*178y block map + level weighing in at only 128K
. Long story short, this means the original 25 meg picture can be represented (on disc at least) in only 145K without much effort at all.
To load the map is a little messy, since it means we've a two pass process. First we load the 8*8 blocks + level, then render this level out to an image, thus creating the 32 by 32 block map image in the process. Once that's created, we can delete the 8 by 8 map (don't need it anymore), create a new map, import the 32 by 32 blocks into the map, then load the 32*32 level.
There's a number of benefits that come to mind, but the most obvious one with such an approach, is that just by paying a little more attention to the size of source media, we can make a dramatic impact on overall size of our final game.
Anyway, I've attached the example bellow...