OSDN Git Service

Encode paletted PNGs more efficiently
authorMatt Sarett <msarett@google.com>
Thu, 28 Jan 2016 23:38:38 +0000 (18:38 -0500)
committerMatt Sarett <msarett@google.com>
Mon, 1 Feb 2016 14:03:34 +0000 (09:03 -0500)
commit2a84e23399840dc365cd03edcbfcf2727a17cd6e
treecd5ded413e882134f7c62ae0cfdaa606e1d0769f
parent795c458c89418885f146f40b8d4de96fb0d08ffe
Encode paletted PNGs more efficiently

Saves about 2 MB of encoded size across affected assets.

Also will enable more efficient decoding.

Specifically, encoded palette values are assumed to be opaque unless
alpha values are provided in a tRNS chunk.  Before this change, we
would wastefully store many opaque alpha values in tRNS chunk.
Additionally, the decoder used to need to premultiply all of these
opaque colors, because the encoded data indicated that they had alpha.

Change-Id: Id21b3b31850c9db6149ced6d20ed5e0ce2d71c5b
tools/aapt/Images.cpp