hugo icon indicating copy to clipboard operation
hugo copied to clipboard

Add image.Trace method that produces an SVG

Open bep opened this issue 5 years ago • 7 comments

In the series "bep gets totally distracted", I'm about to add a image.Trace method.

There are several examples of this work in progress here:

https://temp.bep.is/hugotest/section1/trace/

A quick note: Some of the more detailed traces have bigger file sizes than their source, but they compress great (the gzipped version is < 40%) and of course scales better when you go bigger ...

There will be default options and options in config.toml. With the full set of options the usage will be something like this:

{{ $opts := dict "filter" "previtt" "color" "orange" "low" 30 "high" 100 "turdSize" 50 }}
{{ $traced := $img.Trace $opts }} // => SVG resource

I think the default filter will be luma (brightness), which is also the fastest.

/cc @regisphilibert and gang

bep avatar Aug 21 '19 09:08 bep