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>
Fri, 29 Jan 2016 22:56:45 +0000 (22:56 +0000)
commit3c7235d3868d4bf554d4c1700ac11fc3d4125c71
tree51e11327490ba6ee3f0b2e9201239cf02a1d3d6c
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: I1d5400f71a0e3cb800fd0fc68a04c8c4069da8ef
tools/aapt/Images.cpp