docker run -it --rm --log-driver none -v /images/dir/:/a/ defnotgustavom/triangle triangle -in /a/imagetobechanged.jpg -out /a/modifiedimage.jpg
Process multiple images from a directory concurrently The CLI tool also let you process multiple images from a directory concurrently. You only need to provide the source and the destination folder by using the -in and -out flags.
$ triangle -in <input_folder> -out
You can provide also an image file URL for the -in flag.
$ triangle -in <image_url> -out
The CLI tool accepts also pipe names, which means you can use stdin and stdout without the need of providing a value for the -in and -out flag directly since these defaults to -. For this reason it's possible to use curl for example for downloading an image from the internet and invoke the triangulation process over it directly without the need of getting the image first and calling ▲ Triangle afterwards.
Here are some examples using pipe names:
$ curl -s <image_url> | triangle > out.jpg
$ cat input/source.jpg | triangle > out.jpg
$ triangle -in input/source.jpg > out.jpg
$ cat input/source.jpg | triangle -out out.jpg
$ triangle -out out.jpg < input/source.jpg
You can specify a background color in case of transparent background images (.png) by using the -bg flag. This flag accepts a hexadecimal string value. For example setting the flag to -bg=#ffffff00 will set the alpha channel of the resulted image transparent.
By default the output is saved to an image file, but you can export the resulted vertices even to an SVG file. The CLI tool can recognize the output type directly from the file extension. This is a handy addition for those who wish to generate large images without guality loss.
$ triangle -in samples/input.jpg -out output.svg
Using with -web flag you can access the generated svg file directly on the web browser.
$ triangle -in samples/input.jpg -out output.svg -web=true
Supported output types
The following output file types are supported: .jpg, .jpeg, .png, .bmp, .svg.
Setting a lower points threshold, the resulted image will be more like a cubic painting. You can even add a noise factor, generating a more artistic, grainy image.
Here are some examples you can experiment with:
$ triangle -in samples/input.jpg -out output.png -wf=0 -pts=3500 -st=2 -bl=2
$ triangle -in samples/input.jpg -out output.png -wf=2 -pts=5500 -st=1 -bl=10
Content type
Image
Digest
sha256:a89af1a0d…
Size
2.7 MB
Last updated
over 3 years ago
docker pull defnotgustavom/triangle