# How can I turn an image or svg into Basic Shapes?

**URL:** <https://discourse.processing.org/t/how-can-i-turn-an-image-or-svg-into-basic-shapes/32465>\
**Category:** Coding Questions\
**Created:** [September 28, 2021, 7:49am UTC](https://discourse.processing.org/t/how-can-i-turn-an-image-or-svg-into-basic-shapes/32465 "2021-09-28T07:49:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Violet](https://avatars.discourse-cdn.com/v4/letter/v/ebca7d/32.png) [@Violet](https://discourse.processing.org/u/Violet)\
**Post date:** [September 28, 2021, 7:49am UTC](https://discourse.processing.org/t/how-can-i-turn-an-image-or-svg-into-basic-shapes/32465/1 "2021-09-28T07:49:41Z")

</div>

How to intelligently recognize graphics and extract the outer contour of the icon, especially the third change in the figure.

 ![1](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/f/f1d1343576af840a16ff54bae571edeffa25daf6.jpeg)  
I can’t do it with my current level of knowledge, so I would like to ask if processing can achieve this, or is there any other way to do it, machine learning may be a bit difficult for me LOL.

---

<div class="post-metadata">

**Author:** ![micycle](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micycle/32/201_2.png) [@micycle](https://discourse.processing.org/u/micycle)\
**Post date:** [September 30, 2021, 11:53am UTC](https://discourse.processing.org/t/how-can-i-turn-an-image-or-svg-into-basic-shapes/32465/2 "2021-09-30T11:53:16Z")

</div>

This can be achieved through a _convex hull_ operation (for shape that have holes or multiple islands; for shapes like the heart, computing its convex hull will not return exactly return the shape you’re looking for).

This functionality is provided by a few Processing libraries including my own, [Processing Geometry Suite](https://discourse.processing.org/t/processing-geometry-suite/29924).
