# Can vtk file or vtp file save texture image, or can we write mtl file to reference texture image like obj file?

**URL:** https://discourse.vtk.org/t/can-vtk-file-or-vtp-file-save-texture-image-or-can-we-write-mtl-file-to-reference-texture-image-like-obj-file/11056
**Category:** Development
**Created:** [March 27, 2023, 11:48am UTC](https://discourse.vtk.org/t/can-vtk-file-or-vtp-file-save-texture-image-or-can-we-write-mtl-file-to-reference-texture-image-like-obj-file/11056 "2023-03-27T11:48:49Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Ericsson-paul](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ericsson-paul/32/6761_2.png) [@Ericsson-paul](https://discourse.vtk.org/u/Ericsson-paul)
#### Post date: [March 27, 2023, 11:48am UTC](https://discourse.vtk.org/t/can-vtk-file-or-vtp-file-save-texture-image-or-can-we-write-mtl-file-to-reference-texture-image-like-obj-file/11056/1 "2023-03-27T11:48:50Z")

</div>

When we write a vtk file or vtp file, we can only save the texture coordinates in the file, and the texture image needs to be added to the role at rendering time via SetTexture. w I want to introduce a link to the texture image directly by writing to the vtk file or vtp file or write it directly to the vtk file so that I don’t need to load it manually when visualizing it in ParaView. Texture images

---

<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: [March 27, 2023, 12:13pm UTC](https://discourse.vtk.org/t/can-vtk-file-or-vtp-file-save-texture-image-or-can-we-write-mtl-file-to-reference-texture-image-like-obj-file/11056/2 "2023-03-27T12:13:13Z")

</div>

Hi @Ericsson-paul

You want to use a format that support image texture, you also want to use an exporter.

vtkOBJExporter or vtkGLTFExporter comes to mind.

Best,

---

<div class="post-metadata">

### Author: ![Ericsson-paul](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ericsson-paul/32/6761_2.png) [@Ericsson-paul](https://discourse.vtk.org/u/Ericsson-paul)
#### Post date: [March 27, 2023, 12:21pm UTC](https://discourse.vtk.org/t/can-vtk-file-or-vtp-file-save-texture-image-or-can-we-write-mtl-file-to-reference-texture-image-like-obj-file/11056/3 "2023-03-27T12:21:49Z")

</div>

Thanks for your reply. According to your reply, is it possible to determine that the vtk file or vtp file cannot save texture images or texture image reference paths, but only texture coordinates, and ParaView can only load texture images manually to display the textures in the vtk file

---

<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: [March 27, 2023, 12:25pm UTC](https://discourse.vtk.org/t/can-vtk-file-or-vtp-file-save-texture-image-or-can-we-write-mtl-file-to-reference-texture-image-like-obj-file/11056/4 "2023-03-27T12:25:30Z")

</div>

Yes, this is correct.

You can automatize this using state files or python state files in ParaView though.

---

<div class="post-metadata">

### Author: ![Ericsson-paul](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ericsson-paul/32/6761_2.png) [@Ericsson-paul](https://discourse.vtk.org/u/Ericsson-paul)
#### Post date: [March 27, 2023, 12:34pm UTC](https://discourse.vtk.org/t/can-vtk-file-or-vtp-file-save-texture-image-or-can-we-write-mtl-file-to-reference-texture-image-like-obj-file/11056/5 "2023-03-27T12:34:00Z")

</div>

Thank you for your reply, but I’m sorry I don’t understand it very well, can you be more specific about how to achieve it, or is there a reference link I can learn from?

---

<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: [March 27, 2023, 12:42pm UTC](https://discourse.vtk.org/t/can-vtk-file-or-vtp-file-save-texture-image-or-can-we-write-mtl-file-to-reference-texture-image-like-obj-file/11056/6 "2023-03-27T12:42:43Z")

</div>

How to achieve what ? You questions is not super clear.

---

<div class="post-metadata">

### Author: ![Ericsson-paul](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ericsson-paul/32/6761_2.png) [@Ericsson-paul](https://discourse.vtk.org/u/Ericsson-paul)
#### Post date: [March 27, 2023, 12:45pm UTC](https://discourse.vtk.org/t/can-vtk-file-or-vtp-file-save-texture-image-or-can-we-write-mtl-file-to-reference-texture-image-like-obj-file/11056/7 "2023-03-27T12:45:19Z")

</div>

I’m very sorry for my lack of clarity, I don’t know much about this, I’m asking how to automatize this using state files or python state files in ParaView though.

---

<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: [March 27, 2023, 12:46pm UTC](https://discourse.vtk.org/t/can-vtk-file-or-vtp-file-save-texture-image-or-can-we-write-mtl-file-to-reference-texture-image-like-obj-file/11056/8 "2023-03-27T12:46:24Z")

</div>

You are on VTK discourse though. Please ask ParaView questions on: [https://discourse.paraview.org](https://discourse.paraview.org)

---

<div class="post-metadata">

### Author: ![Ericsson-paul](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ericsson-paul/32/6761_2.png) [@Ericsson-paul](https://discourse.vtk.org/u/Ericsson-paul)
#### Post date: [March 27, 2023, 12:47pm UTC](https://discourse.vtk.org/t/can-vtk-file-or-vtp-file-save-texture-image-or-can-we-write-mtl-file-to-reference-texture-image-like-obj-file/11056/9 "2023-03-27T12:47:52Z")

</div>

Thank you very much for your reply!
