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

Optimizing images #213

Open
Sworddragon opened this issue Dec 24, 2011 · 4 comments
Open

Optimizing images #213

Sworddragon opened this issue Dec 24, 2011 · 4 comments

Comments

@Sworddragon
Copy link

It seems that the images are every time 24 bit PNG files. I'm not sure if there are even more than 256 different objects that can be shown at the world map but c10t could count the different objects (colors) which it will drawn to the image (or per splitted image) and if they are not more than 256 the image could be converted to 8 bit. This would help webservices which provide a online worldmap with c10t to reduce the traffic.

@uap-universe
Copy link
Collaborator

This would only make any sense if the image is not just converted but already computed in 8 bit mode. So the rendering process itself would cost a quarter of the memory it uses now (in 32 bit rgba). This sounds like a huge impact on the source code. The current color class must become an adapter and the attributes inaccessible (as they are not rgba in 8 bit mode). Then the color setter must be overloaded by each representation (32bit / 8bit) and ommit additional information in 8 bit mode.

It's possible, but it would be a huge impact on the source code.

@udoprog
Copy link
Owner

udoprog commented Dec 25, 2011

hm, it's very much possible to produce a non 24 bit (8 bit per channel) and go for 16 bit (4 bit per channel), but the color ranges will be severely truncated.

If you want to implement this it would be during the writing process, but it would be possible to convert the entire process in order to save space using a template-esque implementation of color which ceils/floors on the fly. Dunno the performance or quality degredation tho.

@udoprog udoprog closed this as completed Nov 1, 2013
@Sworddragon
Copy link
Author

For the quality: The intended idea was that c10t makes an automatic optimization. For example it will reduce the color palette only of it doesn't withdraw used colors. And if the palette is below 257 colors it would be an 8 bit PNG.

@udoprog udoprog reopened this Jun 20, 2014
@evildeeds
Copy link
Collaborator

c10t support and handles transparent colors internally, both leaves and water colors are partially transparent and will result in a large number of different colors depending on depth and blocks beneath.

I'm therefore not sure how useful this feature would be, I suppose if you used your own block pallet with few nontransparent colors it would make sense.

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

4 participants