diff options
author | Don Bright <hugh.m.bright@gmail.com> | 2013-09-12 02:47:23 (GMT) |
---|---|---|
committer | Don Bright <hugh.m.bright@gmail.com> | 2013-09-12 02:47:23 (GMT) |
commit | 03a9bfd7d247ee32023a43efe9956a9407d12fa7 (patch) | |
tree | 98caffcfb77472880852f24a360152cee2dfd831 /src/imageutils-lodepng.cc | |
parent | 4a2255f1996f8a0eccf05226ec129b09cf6c4151 (diff) |
lodepng: write RGB instead of RGBA: decoders differ on alpha rendering
Diffstat (limited to 'src/imageutils-lodepng.cc')
-rw-r--r-- | src/imageutils-lodepng.cc | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/imageutils-lodepng.cc b/src/imageutils-lodepng.cc index 9f3afda..46b593d 100644 --- a/src/imageutils-lodepng.cc +++ b/src/imageutils-lodepng.cc @@ -11,12 +11,9 @@ bool write_png(std::ostream &output, unsigned char *pixels, int width, int heigh { std::vector<unsigned char> dataout; lodepng::State state; - state.info_png.background_defined = true; - Color4f bg = RenderSettings::inst()->color(RenderSettings::BACKGROUND_COLOR); - state.info_png.background_r = bg(0); - state.info_png.background_g = bg(1); - state.info_png.background_b = bg(2); - state.info_png.color.colortype = LCT_RGBA; + state.encoder.auto_convert = LAC_NO; + // some png renderers have different interpretations of alpha, so don't use it + state.info_png.color.colortype = LCT_RGB; state.info_png.color.bitdepth = 8; unsigned err = lodepng::encode(dataout, pixels, width, height, state); if ( err ) return false; |