# getTextureData

#### getTextureData

Returns the raw image data of a texture.

#### Signature

```typescript
getTextureData(textureId: string): Promise<TextureData>
```

#### Parameters

| Name        | Type     | Required | Description       |
| ----------- | -------- | -------- | ----------------- |
| `textureId` | `string` | Yes      | ID of the texture |

#### Returns

`Promise<TextureData>` — Texture image data.

```typescript
type TextureData = {
  image: ArrayBuffer;
  width: number;
  height: number;
};
```

#### Usage

```javascript
// Get texture ID from material
const material = await api.getActiveMaterial("Chair");
const textureId = material.baseColor.textureConfig.id;

// Get texture data
const data = await api.getTextureData(textureId);
console.log(`Size: ${data.width}x${data.height}`);
console.log(`Bytes: ${data.image.byteLength}`);
```

#### Notes

* Texture ID can be found in material's texture channels (baseColor, roughness, normal, etc.)
* Returns raw pixel data as ArrayBuffer


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.vectary.com/api/model-api/api-reference/gettexturedata.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
