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

Deduplicate images in sprite atlas #4775

Open
nickidlugash opened this issue Jun 2, 2017 · 3 comments
Open

Deduplicate images in sprite atlas #4775

nickidlugash opened this issue Jun 2, 2017 · 3 comments
Labels
cross-platform 📺 Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.) feature 🍏 performance ⚡ Speed, stability, CPU usage, memory usage, or power usage

Comments

@nickidlugash
Copy link

@kkaefer and I chatted about the possibility of only adding unique sprite images to the atlas, and allowing multiple sprite names to reference the same location.

Spritezero can already generate spritesheets with unique sprite images only, with multiple sprite names referencing the same location on the spritesheet. If a style uses this spritesheet layout option, can we use this data to do something similar in the atlas? Or would we analyze all the images to dedup regardless of whether the spritesheet is deduped?

/cc @mapbox/gl-core

@nickidlugash
Copy link
Author

@kkaefer also mentioned that we could do something similar for font stacks to avoid duplicate CJK glyphs in the atlas when multiple font stacks contain the same CJK fallback font.

@kkaefer
Copy link
Member

kkaefer commented Jun 2, 2017

An alternative implementation might also be to hash the content of every image, and deduplicate based on pixel identity rather than relying on information in the sprite sheet (that'd also be the approach we'd have to take for glyph atlas deduping).

@nickidlugash
Copy link
Author

Main ticket for atlas improvements: #141

@anandthakker anandthakker added performance ⚡ Speed, stability, CPU usage, memory usage, or power usage cross-platform 📺 Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.) labels Aug 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cross-platform 📺 Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.) feature 🍏 performance ⚡ Speed, stability, CPU usage, memory usage, or power usage
Projects
None yet
Development

No branches or pull requests

4 participants