WPAP ART style in grasshopper

Hello Guys,

I am an artist based in Munich and in the last year i started to use grasshopper to help my art process. I am working on a Portrait research project and i am looking to create WPAP ART style in grasshopper. Like the image attached below. ( Image 1, Image 2 ).

It is basically triangulation or Polygonalization based on Brightness( greyscale values) in the image and then colouring the triangulated or polyganalized geometry with a defined colour set( max 10 colours ) corresponding to the Brightness ( Greyscale values). In Addition i would prefer more details in certain areas( i.e Eyes, nose and so on ). I am not able to define these things.

I gave it a try using Squid and shape driver plugins in GH, but it is not like what I expected. I am not able to go further. ( find - Image 3 ) and also find the grasshopper definition attached.

any leads or guidance on this would be highly appreciated.

WPAP voronoi try 1.gh (16.0 KB)

First tests, using K-Mean Clustering + Delaunay Alpha Shape
10000 points, Height =4, 200 clusters, alpha = 0.1


10000 points, Height =4, 200 clusters, alpha = 0.15



WPAP LD.gh (139.3 KB)

Some others tests, playing with simplify curves angle and tolerance …



12 Likes

Hey Laurent,

To start with Thanks for helping me with this. Works sweet. I having fun am experimenting with different variables ;).

Meanwhile, yesterday I started to solve the style using a different logic, will post it here in a bit and would love to get your thoughts on it.

thanks,
Best,
Shankar.

Hello
Many logics can be used but it is not a simple problem. So it will be interesting to see other ways of doing.

Hello Laurent,
you are totally right.
Here you go i tried something out. ( find image 1 )

Step 1.I created a pop 2d and passed it through an image sampler.
Step 2. i created polygons with the Points created by the points 2D component.
Step 3. with the polygons created i isolated them into 9 different groups based on the Brightness values optained from the image sample.
Step 4. Then i gave them seperated RGB values.

Please find the attached image ( image 1)
and also the GH defenition. might be a bit too heavy to load sorry about that.

to Start with i am happy with the output, but it has too many jaggged edges. Is there a way we could create a smooth geometry( simple polygons with out too many jagged edges) is there a way around it. ? (( image 2))

May be i was thinking.
In step 2 instead of creating polygons. i can directly isolate the points ( from pop 2D) into 9 different groups based on the Brightness values optained from the image sampler
in step 3 : I could create defined polygonal meshes / surfaces ( using a set of isolated points)
I am not much experienced with Mesh opereations. Your inputs is highly appreciated.

thanks
Shankar200105_WPAP _SHR.gh (6.6 MB)

1 Like


I tried to simplify your definition. In order to group color, I transform Color Brightness (a double) to a point (0,0,brigthness) then I used closest point to search to have the index of closest color (respect with Luminance or Brightness)

Then I use an Elefront component to put your shapes in a data tree, on each branch a color.
The Region Union
Then Smooth polyline but you can skip it and go directly to Simplify.

Nota : I had to install Shape Diver plugin because of the bitmap component, but it could be replaced by legacy Import Image and then bounding box to have the size in pixel of the image, then it could be possible to have the color without image sampler …
200105_WPAP _SHR_LD.gh (6.6 MB)

2 Likes

Another version with more Legacy components


200105_WPAP _SHR_LD_v2.gh (17.9 KB)

And a version using Mesh iso splitting


200105_WPAP _SHR_LD_v3.gh (17.5 KB)

Hello Laurent,

Thanks for the reply.

I took V2 Gh file and this is what i acheived and its really promising.
Find a few try outs i did.

I was wondering if we can add 2 new features to the script. Let me know what you think about it.

  1. there are a few cubes / dots which are small as they dobnt belong to the cluster Is it possible to cull them out ( so the pictures would look really clean) How do it do it ?

  2. Is it possible to add more point popullation ins specific areas ( say eyes or nose) which require more detail and correspondingly adjust the polygon radius size and less in areas which dont require much detail ( and later step we could pool it into one stream). This i beleive would help us create rally abstract WPAP image. If so how do i do it .?

What do you think.

Thanks again for your efforts. This is getting really interesting.

Best,
Shankar