fogleman / primitive

Reproducing images with geometric primitives.
https://primitive.lol/
MIT License
12.34k stars 607 forks source link

Bounding box for generated SVG images? #88

Open thomas-kahn opened 4 years ago

thomas-kahn commented 4 years ago

Hi!

This is a great piece of software! I'm currently experimenting with it and I have a question regarding the bounding box for generated SVG-files.

If I select a JPEG that is 1920 x 720 pixels in dimensions and use the following code:

primitive -i mvp.jpg -o output.svg -n 75 -m 8 -s 1920

...the background rectangle gets the correct dimensions, but the bounding box for the generated SVG becomes 2152,5 x 952,5 pixels. This happens because the polygons "poke out" from the original bounding box of the image.

primitive-svg

Is there a way to make primitive generate an SVG which respects the original bounding box and doesn't have the polygons poke out of the image?