Issue700

Title make_atlas does handle palette image faulty
Priority bug Status open
Assigned To Keywords
Linked issues Watchers

Submitted on 2013-10-01 18h37 by matthiaskrgr, last changed by digifuzzy.

Files
File name Uploaded Type Edit Remove
FD_opti.bz2 digifuzzy, 2014-12-24.06:29:31 application/x-bzip2
FD_opti_fix.bz2 digifuzzy, 2014-12-28.06:13:25 application/x-bzip2
FD_opti_no_opt.bz2 digifuzzy, 2014-12-28.06:13:42 application/x-bzip2
FD_opti_nofixforce.bz2 digifuzzy, 2014-12-28.06:13:59 application/x-bzip2
fdoptipng digifuzzy, 2014-12-24.06:30:29 text/plain
summary digifuzzy, 2014-12-24.06:30:06 text/plain
Messages
Author: matthiaskrgr Date: 2013-10-01   18h37
to reproduce:

cd graphics/obstacles
optipng *
make clean
make

=> some obstcales, for example the wire-fences have black background now

So far we avoided this by running optipng with
    -np			no palette reduction

but I'd actually like to fully-"optimize" the images.
Author: digifuzzy Date: 2014-12-24   06h47
tl;dr what kind of optimization do we want to achieve - speed / memory usage
during game - OR - storage footprint?

optipng version: 0.7.5
libpng version: 1.6.16
zlib version: 1.2.8

Using the shell script fdoptipng.sh (attached as fdoptpng), I ran optipng
against a folder containing copies of the images from FDRPG. Compared against a
folder of "untouched" copy images, I was only able to achieve a savings of ~350
bytes. The script also took just over an hour to complete (6-core AMD bulldozer
- sorry matthias :) ).

du -d1.
131860	./freedroid_orig
131424	./freedroid_optiforce

A copy of the log file from the process is attached in tar.bz2 format.

Of note is the "summary" file. This file lists all "unique" palettes optipng
found during optimization. For the most part, FDRPG images are reported to use
system 4x8 bit/RBG+Alpha. However, numerous other "non-standard" palettes were
encountered, especially with "shadow" images. If this is an exercise in saving
space, I doubt much was achieved.

Also of concern is a possible performance penalty. Having numerous images (FDRPG
has 1600+ png's) each with a non-standard palette would had a memory hit. Do we
want to reduce files for space but lose runtime optimization because of using a
unique palette for a large number of immages?

As an explanation for the error, some images encountered were monochrome or
limited colours. Using optipng with the fix and force options (see man optipng
for explanations) prevented the error from occurring.

I would suggest this error indicates a problem with consistency in how files are
exported/produced from blender in certain situations (or they have been
previously "optimized").
Author: digifuzzy Date: 2014-12-24   06h49
two things...
std palette - 4x8*BYTES*/RBG+Alpha
expanded log file is ~13M
Author: digifuzzy Date: 2014-12-27   20h56
Did I ever screw up the last comment...

The default palette used is 4x8bits/pixel RGB+Alpha
Author: digifuzzy Date: 2014-12-28   06h11
Re ran optipng against a copy of folders.
Time was ~ 2h for each run.
no errors were encountered with/without -np option

Results:
size   | optipng parameters
-------|-------------------
131864 | original - not optimized
131412 | -o7 -clobber -fix -force
130512 | -o7 -clobber -fix
130516 | -o7 -clobber
130512 | -o7 -np -clobber
Author: digifuzzy Date: 2014-12-28   06h20
Attaching log files.
Logs compressed into bz2.
Each archive expands to ~13MB text file.

     log file name |  optipng parameters
-------------------|---------------------
FD_opti            | -o7 -clobber -fix -force
FD_opti_fix        | -o7 -clobber -fix
FD_opti_no_opt     | -o7 -clobber
FD_opti_nofixforce | -o7 -np -clobber

see optipng man page for details of parameters.
History
Date User Action Args
2014-12-28 06:20:24digifuzzysetmessages: + msg3014
2014-12-28 06:13:59digifuzzysetfiles: + FD_opti_nofixforce.bz2
2014-12-28 06:13:42digifuzzysetfiles: + FD_opti_no_opt.bz2
2014-12-28 06:13:25digifuzzysetfiles: + FD_opti_fix.bz2
2014-12-28 06:11:21digifuzzysetmessages: + msg3013
2014-12-27 20:56:19digifuzzysetmessages: + msg3012
2014-12-24 06:49:19digifuzzysetmessages: + msg3011
2014-12-24 06:47:48digifuzzysetmessages: + msg3010
2014-12-24 06:30:29digifuzzysetfiles: + fdoptipng
2014-12-24 06:30:06digifuzzysetfiles: + summary
2014-12-24 06:29:31digifuzzysetfiles: + FD_opti.bz2
2013-10-01 18:37:15matthiaskrgrcreate