Deduplicate images in sprite atlas
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
@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](https://github.com/mapbox/spritezero/blob/master/index.js#L9), 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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the linked spritezero index.js behavior and tracing how sprite images are added to the atlas in mapbox-gl-js. Determine whether to consume existing deduplication data or compare images directly; done means duplicate images occupy one atlas location while all sprite names still resolve correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- computer-graphics, frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100