Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support full color png as rgb (no alpha) #1559

Closed
springmeyer opened this issue Nov 6, 2012 · 7 comments
Closed

Support full color png as rgb (no alpha) #1559

springmeyer opened this issue Nov 6, 2012 · 7 comments
Milestone

Comments

@springmeyer
Copy link
Member

In cases where the overhead of color reduction (png8) is not desirable, but full color rgba png's are too large, we can save some space by writing no-alpha rgb images.

We already support a flag for png8 encoding that allows the user to force the transparency level: 0 for no transparency, 1 for binary transparency, and 2 for partial transparency.

Therefore we can allow png:t=0 to be able to write true color rgb images.

@springmeyer
Copy link
Member Author

miniz setup for this in cd3cc31

@cquest
Copy link

cquest commented Aug 19, 2013

Images are really different: on my quick test, png:t=0 reduces image size by 7%, but the time to generate t
he same 1024x1024 pixel image increases by... 33% :(

test-png

test-png-t-0

@springmeyer
Copy link
Member Author

@cquest - can you also try png8:t=0?

@cquest
Copy link

cquest commented Aug 19, 2013

@springmeyer with "png8:t=0" I get the same timing as "png"

@springmeyer
Copy link
Member Author

@cquest so you are comparing to png8 then?

@cquest
Copy link

cquest commented Aug 20, 2013

Here are the best timing I got:

png8 > 29, 30 and 29s
png8:t=0 > 33, 34 and 35s

I rechecked with "png" and "png:t=0", I now get the same timings... (around 30s, 3 tests each).

@springmeyer
Copy link
Member Author

png8:t=0 should be faster than png8, but clearly it is not and I'm not sure why. If you want to work around this issue and these speeds are not acceptable, then I recommend trying a few things:

  1. Record timings for rendering without actually encoding (e.g. in python just call im.tostring() without the png argument) so you can get a sense of how long rendering is taking vs image encoding.

  2. Consider using mapnik image views to encode the image in parts and then stitching back together. This might be slower, but could also be faster since the memory needed to handle smaller chunks of images in the png encoder might be less.

PetrDlouhy pushed a commit to PetrDlouhy/mapnik that referenced this issue Aug 22, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants