3 ms·
I guess this would be a good time to plug a small project I worked on: https://github.com/rben01/collagen https://github.com/rben01/collagen . I got tired of se
by bobbylarrybobby 4y ago
I guess this would be a good time to plug a small project I worked on: https://github.com/rben01/collagen https://github.com/rben01/collagen . I got tired of seeing how crappy text looked when placed on a JPEG (due to the compression artifacts) and how large some PNGs were because they had a small JPEG-like area, so I made a little CLI program that solves that problem. Rather than settle on any particular image format, it allows the user to provide a collection of inputs -- images (in any format your browser supports), SVGs, shapes, text -- and bundles them into a single SVG file (it base64 encodes the images). So if you want to scale a PNG and place it on top of a JPG, you... just do that, with SVG transforms and whatnot. It produces a single file and is a lot easier than writing out the SVG yourself, and is nearly as easy as opening up a tailor-made mage editor and doing it there. And it's really, truly lossless, as it doesn't touch any of the input data.
In theory, you wouldn't even transmit the SVG directly; you'd zip up the components and send them across the network and then encode them into an SVG on the other end, which would mitigate some of the size increase due to base64 encoding.