psolbach / iconbin

Beautiful favicons API
27 stars 2 forks source link

Add spritesheets to the delivery method #18

Open DaBs opened 8 years ago

DaBs commented 8 years ago

As titlen suggests. A user should be capable of requesting a spritesheet with a given array of icons in it. Discussion about implementation below.

psolbach commented 8 years ago

This is a feature I would very much like to see as well. Implementation might be hairy though. The whole concept of iconbin relies on the built-in "afterburner" we get with any file hosted on Github though MaxCDN. Generating images dynamically will require a dedicated caching layer. And the integration of C libs like imagemagick to composite Bitmaps is not something I would wanna tackle right now. However, we could offer individual downloads of SVG spritesheets that reference Base64 encoded bitmap data or other SVGs. Like so <image width="100" height="100" xlink:href="data:image/png;base64,...">.

DaBs commented 8 years ago

Is it naive to believe that perhaps the spritesheet service should only be available for svgs, to, as you said yourself, rid us of having to do image manipulation for now?

I'm imagining that, much like the current solution, people can go into a SVG spritesheet editor and pick and choose the icons they'd like from the icon repo. Once a spritesheet has been made this way, it gets named according to a naming convention we have, saved to the GitHub repo and thus becomes something other users can take advantage of. Or the API could do the same automatically for you when you attempt a GET request, based on some parameters, just as long as we're not dealing with bitmaps.