Skip to content

Add image.Trace method that produces an SVG #6253

@bep

Description

@bep

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions