Transparent Logo PNG

Hey there,

i try to give the user the opportunity to upload their logo in a .png format in black and white to be laserengraved in the surface.
the result is supposed to be a bitmap (the logo) with opacity.

in grasshopper everything is fine and the result looks like i want to, but in the shapediver viewer it looks like it erases itself?
this is the model i’m referring to:

my model

happy to hear from you

In a future update, the alpha channel of the PNG will be taken into account, without having to use an opacity map, which complicates things.

In the meanwhile, using the opacity map is the correct way to get it done, however you can’t use the original image as an opacity map. The opacity map should be black for transparent pixels and white for opaque pixels. Since your image contains an alpha channel, the best way is to create a second image with grey pixels containing the alpha value (R,G,B,A) -> (A,A,A,A) and use it as the opacity map.

I am attaching a definition with a small script doing just that. At the end of the script, add a GrasshopperBitmap component to make sure the resulting image is compatible with the other Grasshopper components. (19.6 KB)

1 Like

the script works perfectly,
thanks a lot for the fast reply!

1 Like