optimized-images-loader
optimized-images-loader copied to clipboard
feature: add svg traces
Description
- This adds the
?traceparameter for generating SVG image traces using thepotracelibrary.- other options should work as well, like
resize,width, andheight(I have not tested the rest though). By default, svg trace will create a trace of a full-sized image, which is slow. I recommend resizing the image down usingresizeandwidthorheight.
- other options should work as well, like
- Also optimizes the inline data string for SVGs using
mini-svg-data-uri-gatsby-plugin-sharpdoes this as well. https://webpack.js.org/loaders/url-loader/#svg
This implementation is heavily based on the one used in gatsby-plugin-sharp (seen here)
Images
Example Image:

Example Img Component:

Trace:

Todo
- [ ] How should
potraceoptions be passed? Morerequirequery arguments? - [ ] General note: should images have quality/progressive options?
Thanks again, @cyrilwanner, for making this awesome image tool suite. It's much appreciated!