Image Compression Automation
Added 2019-01-23 07:41:33 +0000 UTCYesterday I decided it was time to sink my teeth into the image compression work I've been putting off for a while. After some testing and false starts (as well as discovering namespace overlap that was stopping the "standing_doggy" images from being cropped correctly) I now have a proper workflow established. Previous to this the image pipeline looked something like this:
Rendering -> Cropping -> Character Images Folder
When rendered images would sit in a folder until I ran my cropping script, which cut them down to the proper screen size depending on the position they were for. They were then placed into the game images folder to be used in LR2. The new pipeline looks like this:
Rendering -> Cropping -> Compression -> Character Images Folder
At each step the images are duplicated, so I can always go back to the raw rendered images, or their cropped versions, or the new final compressed versions. This helps me avoid re-rendering things if I end up needing a different crop size, compression technique, etc.
The actual compression cuts the colour pallet of the .png images down to reduce their total size. A quick look through the file sizes suggests a reduction in size of about 50%, in some cases more. The difference in image quality has so far been imperceptible. Below is an example of the compressed and uncompressed version of the same clothing item. The compression process for the full library of images takes about 35 minutes to finish, meaning it will not be a limiting step in the image creation pipeline.

Comments
very nice. just curious if the white spots in costumes is a byproduct of whatever design program you are using?
John
2019-01-25 14:49:18 +0000 UTCWhich tool are you using? I've historically been fond of PNGCrush, but I think there are supposed to be better ones now.
Isaac Dansicker
2019-01-24 22:03:44 +0000 UTCVery good!
2019-01-23 23:49:02 +0000 UTCKeep up the good work!
Terebonkoff Game Studio
2019-01-23 08:30:50 +0000 UTC