# Is there any way i can extract the texture images from the glb file within threejs

**URL:** https://discourse.threejs.org/t/is-there-any-way-i-can-extract-the-texture-images-from-the-glb-file-within-threejs/35220
**Category:** Questions
**Created:** [February 23, 2022, 9:16am UTC](https://discourse.threejs.org/t/is-there-any-way-i-can-extract-the-texture-images-from-the-glb-file-within-threejs/35220 "2022-02-23T09:16:50Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![iamvvx](https://avatars.discourse-cdn.com/v4/letter/i/5f9b8f/32.png) [@iamvvx](https://discourse.threejs.org/u/iamvvx)
#### Post date: [February 23, 2022, 9:16am UTC](https://discourse.threejs.org/t/is-there-any-way-i-can-extract-the-texture-images-from-the-glb-file-within-threejs/35220/1 "2022-02-23T09:16:50Z")

</div>

how to get the gltf model’s texture image out

loader.load(‘static/model/m3.glb’, function(glt) {  
gltf = glt;  
const parser = glt.parser;  
const bufferPromises = parser.json.images.map((imageDef) =\> {  
return parser.getDependency(‘bufferView’, imageDef.bufferView);  
});

```
				Promise.all(bufferPromises).then((buffers) => {  
					console.log(buffers);  
					// var bytes = new Uint8Array(buffers);
					// var image = document.getElementById('image');
					// var bytes = new Uint8Array(buffers);
					// image.src = 'data:image/png;base64,'+ encode(bytes);
					// console.log("====>");
					// console.log(imageUrl); 
				});
```
