perf: minimize sprites#18
Conversation
The images can be minimized using TinyPNG. For v4, this gives us a saving of around 50%, but some images even more. Signed-off-by: André Andersson <andre.andersson@zenon.se>
|
What "TinyPNG" are you referring to? the original source for the sprites is https://github.com/protomaps/basemaps/tree/main/sprites , which also describes how to build the sprite sheets. This is a useful optimization but it needs to be integrated into that build process. Either we require the developer installs the tinypng tool, which depends on how widely available it is, or we need a PNG optimization alternative that can be called from the Rust program. |
|
Sorry for a late response here, been on vacation for awhile :) TinyPNG in this case is a service: https://tinypng.com/ Haven't actually worked in Rust, but... There seems to be some API-clients written in rust specifically for TinyPNG (see tinify). But if we don't want the dependency on a service perhaps minipng could be something? Perhaps we should close this PR and start a discussion / issue instead, if this isn't the solution we want? :) |
|
I see hosting sprites on a third party like GitHub Pages as only a temporary solution, in the long term the best solution will be a SVG -> optimized PNG pipeline that bundles the sprites in the |
The images can be minimized using TinyPNG. For v4, this gives us a saving of around 50%, but some images even more.