# How to add the color of gray image to point cloud

**URL:** https://discourse.vtk.org/t/how-to-add-the-color-of-gray-image-to-point-cloud/4856
**Category:** Support
**Created:** [December 18, 2020, 3:01pm UTC](https://discourse.vtk.org/t/how-to-add-the-color-of-gray-image-to-point-cloud/4856 "2020-12-18T15:01:38Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Ethan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ethan/32/2756_2.png) [@Ethan](https://discourse.vtk.org/u/Ethan)
#### Post date: [December 18, 2020, 3:01pm UTC](https://discourse.vtk.org/t/how-to-add-the-color-of-gray-image-to-point-cloud/4856/1 "2020-12-18T15:01:38Z")

</div>

When I use the settablevalue function in vtklookuptable, I can only set the value of RGBA, but my image is a gray image. How can I set the color to the point cloud?

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [December 20, 2020, 8:17pm UTC](https://discourse.vtk.org/t/how-to-add-the-color-of-gray-image-to-point-cloud/4856/2 "2020-12-20T20:17:42Z")

</div>

Hi, Ethan,

Set the same gray level value for R, G and B.

cheers,

Paulo

---

<div class="post-metadata">

### Author: ![Ethan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ethan/32/2756_2.png) [@Ethan](https://discourse.vtk.org/u/Ethan)
#### Post date: [December 21, 2020, 2:26pm UTC](https://discourse.vtk.org/t/how-to-add-the-color-of-gray-image-to-point-cloud/4856/4 "2020-12-21T14:26:30Z")

</div>

thanks you very much；  
The same color needs to be reversed  
However, I have another problem. After I click the button to display the point cloud, and then click the button to display the point cloud repeatedly, the memory will keep rising. I don’t know how to clear the previous display. Please give me your proposal

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [December 21, 2020, 7:16pm UTC](https://discourse.vtk.org/t/how-to-add-the-color-of-gray-image-to-point-cloud/4856/5 "2020-12-21T19:16:02Z")

</div>

Hi, Ethan,

> [@Ethan](#):
>
> The same color needs to be reversed

Forgive me, but I didn’t understand it. If you set R, G and B to the same value you get a gray color (or black or white).

> [@Ethan](#):
>
> After I click the button to display the point cloud, and then click the button to display the point cloud repeatedly, the memory will keep rising. I don’t know how to clear the previous display. Please give me your proposal

You have to remove the autor that is already in the scene: `renderer->RemoveActor(actor);`. You’re likely creating multiple actors representing the same point cloud.

cheers,

Paulo
