# Transparent png import in Grasshopper

**URL:** <https://discourse.mcneel.com/t/transparent-png-import-in-grasshopper/102274>\
**Category:** Grasshopper\
**Tags:** png, transparent\
**Created:** [May 16, 2020, 3:09pm UTC](https://discourse.mcneel.com/t/transparent-png-import-in-grasshopper/102274 "2020-05-16T15:09:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![balthavdrest](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/balthavdrest/32/222919_2.png) [@balthavdrest](https://discourse.mcneel.com/u/balthavdrest)\
**Post date:** [May 16, 2020, 3:09pm UTC](https://discourse.mcneel.com/t/transparent-png-import-in-grasshopper/102274/1 "2020-05-16T15:09:48Z")

</div>

Hi everyone,

I have to import a transparent png file in grasshopper. I used the “Import Image” component, and locally set one existing file.  
When I import the image directly in Rhino, no problem, the background is transparent, but when I import in Grasshopper, the background becomes black. I need it imported via gh so I can place it right in my model.

Thank you.

Balthazar

---

<div class="post-metadata">

**Author:** ![carlossonline](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/carlossonline/32/225230_2.png) [@carlossonline](https://discourse.mcneel.com/u/carlossonline)\
**Post date:** [May 16, 2020, 4:11pm UTC](https://discourse.mcneel.com/t/transparent-png-import-in-grasshopper/102274/2 "2020-05-16T16:11:48Z")

</div>

> [@Help Us Help You](https://discourse.mcneel.com/t/how-to-ask-effective-questions/50034):
>
> Asking questions and getting answers is what this forum is all about. Although people are generally very helpful, there are things you can do to improve your chances of getting good and quick answers. Below you will find some suggestions, but don’t think of them as rules and especially don’t think of them as guarantees. 1. Choose a descriptive title for your post Don’t title your question Help! or I have a problem or Deadline tonight!, but actually describe the problem you are having. 2. Be s…

Would be good to see some files.

---

<div class="post-metadata">

**Author:** ![balthavdrest](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/balthavdrest/32/222919_2.png) [@balthavdrest](https://discourse.mcneel.com/u/balthavdrest)\
**Post date:** [May 16, 2020, 5:14pm UTC](https://discourse.mcneel.com/t/transparent-png-import-in-grasshopper/102274/3 "2020-05-16T17:14:58Z")

</div>

Indeed.

 ![png import fail](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/f/7/f7af5d5b1c545954cc98b8adf1f296c76d8769b9.jpeg) [png import fail.gh](https://discourse.mcneel.com/uploads/short-url/5VuIi6zHB7vOINGEwBzSK5nu7tn.gh) (4.9 KB)

---

<div class="post-metadata">

**Author:** ![maje90](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/maje90/32/771922_2.png) [@maje90](https://discourse.mcneel.com/u/maje90)\
**Post date:** [May 16, 2020, 7:17pm UTC](https://discourse.mcneel.com/t/transparent-png-import-in-grasshopper/102274/4 "2020-05-16T19:17:52Z")

</div>

Those are two completely different things.  
On rhino the image is imported as a surface with pre-applied material, and the material uses the original picture as texture.

On grasshopper the “Import Image” component outputs a mesh with colored vertexes! (much heavier process)  
You can cull the vertexes of the mesh by a color… as it seems that alpha channel is lost, you can use black (hoping it is not used in the picture itself).

 ![2020-05-16 21_13_13-Window](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/2/b/2bfc6c67dde0580a69bef2a145e22a644eae8dd9.png)  
[mesh\_cull\_vertexes\_by\_color.gh](https://discourse.mcneel.com/uploads/short-url/pKCFTBd3bEv896hCAN3gpxNtFYK.gh) (10.2 KB)  
(Added a c# version of the same culling … it is faster)

Note that working with meshes in this way can slow down everything… huge amount of points.

Probably there are better methods to implement actual texturing withing grasshopper…

---

<div class="post-metadata">

**Author:** ![balthavdrest](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/balthavdrest/32/222919_2.png) [@balthavdrest](https://discourse.mcneel.com/u/balthavdrest)\
**Post date:** [May 16, 2020, 8:47pm UTC](https://discourse.mcneel.com/t/transparent-png-import-in-grasshopper/102274/5 "2020-05-16T20:47:21Z")

</div>

Thank’s a lot for clearing things up! I didn’t know it was creating a mesh… This solution is unfortunatly still too heavy for what I have to build, maybe i’m missing on something obvious.

How would you do if u had to represent approximately 6000 shrubs (grapevines) placed at specific spots determined in grasshopper ?

Is there anyway to use the surface with material in grasshopper ?

---

<div class="post-metadata">

**Author:** ![maje90](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/maje90/32/771922_2.png) [@maje90](https://discourse.mcneel.com/u/maje90)\
**Post date:** [May 16, 2020, 9:00pm UTC](https://discourse.mcneel.com/t/transparent-png-import-in-grasshopper/102274/6 "2020-05-16T21:00:15Z")

</div>

> [@balthavdrest](#):
>
> 6000 shrubs (grapevines)

Different model/texture each other? Or just different position/orientation/scale?  
If the latter, create one/some block in rhino and use grasshopper to place new instances on the rhino file. There are plenty of plugins to handle blocks. I can’t advice one in specific as i don’t use block even on rhino…

---

<div class="post-metadata">

**Author:** ![balthavdrest](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/balthavdrest/32/222919_2.png) [@balthavdrest](https://discourse.mcneel.com/u/balthavdrest)\
**Post date:** [May 17, 2020, 11:42am UTC](https://discourse.mcneel.com/t/transparent-png-import-in-grasshopper/102274/7 "2020-05-17T11:42:32Z")

</div>

Thank’s a lot ! using blocks worked fine, I used Elefront plugin.  
I actually used 4 different images and applied a random rotate and scale.

Have a good day and thank you for your help !
