# Storing RGBA values directly to VTI file for 2D data

**URL:** https://discourse.vtk.org/t/storing-rgba-values-directly-to-vti-file-for-2d-data/3830
**Category:** Support
**Created:** [July 22, 2020, 4:48pm UTC](https://discourse.vtk.org/t/storing-rgba-values-directly-to-vti-file-for-2d-data/3830 "2020-07-22T16:48:58Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![sdutta](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/e19b73/32.png) [@sdutta](https://discourse.vtk.org/u/sdutta)
#### Post date: [July 22, 2020, 4:48pm UTC](https://discourse.vtk.org/t/storing-rgba-values-directly-to-vti-file-for-2d-data/3830/1 "2020-07-22T16:48:58Z")

</div>

I am wondering if it would be possible to store RGBA values into 2D VTI files instead of traditional data values. We are working on something which requires designing Opacity TF based on some criteria and we are trying to do it for 2D data. This is similar to using ParaView, doing a surface rendering and then checking the box to enable opacity function on it. Please let me know if it can be done and is there any example that will allow us to do so.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [July 23, 2020, 7:38am UTC](https://discourse.vtk.org/t/storing-rgba-values-directly-to-vti-file-for-2d-data/3830/2 "2020-07-23T07:38:58Z")

</div>

Yes, it can be done. Just create a 4 component array in your image data.

---

<div class="post-metadata">

### Author: ![sdutta](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/e19b73/32.png) [@sdutta](https://discourse.vtk.org/u/sdutta)
#### Post date: [July 23, 2020, 8:13pm UTC](https://discourse.vtk.org/t/storing-rgba-values-directly-to-vti-file-for-2d-data/3830/3 "2020-07-23T20:13:07Z")

</div>

Thanks Mathieu, it worked!  
Just for a reference: When we want to visualize such a file in ParaView, to see the desired result we have to uncheck the Map Scalars option in the Properties window.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [July 24, 2020, 8:14am UTC](https://discourse.vtk.org/t/storing-rgba-values-directly-to-vti-file-for-2d-data/3830/4 "2020-07-24T08:14:51Z")

</div>

Yes indeed.
