Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Use RGB buffers with solid background #866

Closed
artemp opened this Issue Oct 11, 2011 · 4 comments

Comments

Projects
None yet
2 participants
Owner

artemp commented Oct 11, 2011

When drawing a pixel map and the background color/image is solid, the drawing buffer should be RGB; the alpha component isn't needed in that case. This might allow us to simplify and speed up some drawing code.

Owner

artemp commented Oct 11, 2011

[springmeyer] interesting idea tracking rgb back into the renderer - agg has types for rgb that could be easy to switch out potentially - hadn't considered that. we do expose transparency level as an option during png quantization, so the question would be whether that is settable with png32 and also whether any speedups could be had during encoding either png32 or png8 by telling libpng its rgb rather than rgba.

Owner

artemp commented Oct 11, 2011

[kkaefer] When passing PNG_COLOR_TYPE_RGB, setting PNG_TRANSFORM_STRIP_FILLER_AFTER when calling png_write_png encodes the RGBA buffer as RGB.

Owner

artemp commented Oct 11, 2011

[kkaefer] Seems like PNG_TRANSFORM_STRIP_FILLER_AFTER is only an option when using the high level interface that wraps png_write_info, png_write_row and png_write_end into one call. The call for the lower level interface is png_set_filler(png_ptr, 0, PNG_FILLER_AFTER);

Owner

artemp commented Oct 11, 2011

[kkaefer] Patch at https://github.com/kkaefer/mapnik2/compare/png24 makes "png24" actually encode images as 24 bit PNGs instead of 32 bit PNGs. I noticed that this change has minimal to no effect on file size and it had a slightly negative impact on encoding speed.

@springmeyer springmeyer closed this Sep 6, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment