# Get Texture Image from glb file

**URL:** <https://forum.babylonjs.com/t/get-texture-image-from-glb-file/23444>\
**Category:** Questions\
**Created:** [August 31, 2021, 2:00am UTC](https://forum.babylonjs.com/t/get-texture-image-from-glb-file/23444 "2021-08-31T02:00:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Muhamad\_Rifky](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/muhamad_rifky/32/7838_2.png) [@Muhamad\_Rifky](https://forum.babylonjs.com/u/Muhamad_Rifky)\
**Post date:** [August 31, 2021, 2:00am UTC](https://forum.babylonjs.com/t/get-texture-image-from-glb-file/23444/1 "2021-08-31T02:00:07Z")

</div>

Hi all,

how can i extract texture image from glb file?

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/6/2/62e802cfcb7c471e8b93a1582822a62e81043e82.jpeg)

I’ve tried the method on this topic [Get texture source from GLB files](https://forum.babylonjs.com/t/get-texture-source-from-glb-files/12575) but still not working

this is my PG: [https://playground.babylonjs.com/#HV2W7Y#3](https://playground.babylonjs.com/#HV2W7Y#3)

thank you 🙂

---

<div class="post-metadata">

**Author:** ![Mr\_K](https://avatars.discourse-cdn.com/v4/letter/m/e56c9b/32.png) [@Mr\_K](https://forum.babylonjs.com/u/Mr_K)\
**Post date:** [August 31, 2021, 3:09am UTC](https://forum.babylonjs.com/t/get-texture-image-from-glb-file/23444/2 "2021-08-31T03:09:10Z")

</div>

You’re very close, you can get the textures from the asset container like so `assets.textures` this will give you an array with all the textures in the .glb scene. Once you have them you can easily assign them to another material.

Here it is in the playground.  
[https://playground.babylonjs.com/#HV2W7Y#2](https://playground.babylonjs.com/#HV2W7Y#2)

---

<div class="post-metadata">

**Author:** ![Muhamad\_Rifky](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/muhamad_rifky/32/7838_2.png) [@Muhamad\_Rifky](https://forum.babylonjs.com/u/Muhamad_Rifky)\
**Post date:** [August 31, 2021, 3:19am UTC](https://forum.babylonjs.com/t/get-texture-image-from-glb-file/23444/3 "2021-08-31T03:19:58Z")

</div>

but I want the texture image to be used on the img.src element. is there a way to convert that texture into an image file?

---

<div class="post-metadata">

**Author:** ![Muhamad\_Rifky](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/muhamad_rifky/32/7838_2.png) [@Muhamad\_Rifky](https://forum.babylonjs.com/u/Muhamad_Rifky)\
**Post date:** [August 31, 2021, 4:16am UTC](https://forum.babylonjs.com/t/get-texture-image-from-glb-file/23444/4 "2021-08-31T04:16:30Z")

</div>

finally I found the answer 😁, I took the buffer from the texture then changed it to base64 and put it into the image element.

this is my PG : [https://playground.babylonjs.com/#0AM2NX#10](https://playground.babylonjs.com/#0AM2NX#10)
