Trouble Mapping Brightness to Height in Grasshopper

Hi all,

I have a PNG image where I’d like to assign height values to the white areas (the crystals) based on brightness - so the brightest parts would be the highest, following a gradient scale.

I’ve written a Grasshopper script to do this, but the results don’t look quite right. It seems to be picking up too much white, and I’m not sure how to fix it.

I’ve attached an image showing what’s happening - the second and third outputs look okay, but the others don’t seem right. I’ve also included the PNG and Grasshopper file for reference.

Any ideas or suggestions would be greatly appreciated! I’m trying to visualise how these crystals grow over time, and want it to look really cool not like they do now haha.

Flat_Salt_Experiment_GH_Script_P05.gh (14.2 KB)

Internalize your image

The image is in the post.

1 Like