fogleman / primitive

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

Support source image transparency #31

Closed eoghanmurray closed 7 years ago

eoghanmurray commented 7 years ago

The simple case I'm thinking is when transparency in my source image is a simple mask i.e. the opaque areas are contiguous and the alpha channel is either zero or one (apart from anti-aliasing at the edges). I imagine I'm looking for a solution that mainly picks primitives that (mostly) fit within the mask, i.e. the output primitives can be fully opaque.

The more complex case is one with graduations of transparency and islands of full transparency. I imagine in that case you'd want to add the alpha channel as an extra dimension along with rgb (for error calculation etc.)