# Class: CompressedTexture

Defined in: spryte/dist/ktx2.d.ts:8

A block-compressed image, ready to upload as it is: it stays compressed in video memory, at 1 byte per pixel
instead of 4. Make one with [parseKtx2](../functions/parseKtx2.md) and draw it like any image. Only the WebGL2 backend can draw it,
and only when the GPU supports its format: check `draw.compressedFormats` and load another file otherwise.

## Constructors

### Constructor

> **new CompressedTexture**(`width`, `height`, `format`, `levels`, `premultiplied`): `CompressedTexture`

Defined in: spryte/dist/ktx2.d.ts:16

#### Parameters

##### width

`number`

##### height

`number`

##### format

[`CompressedFormat`](../type-aliases/CompressedFormat.md)

##### levels

readonly `Uint8Array`\<`ArrayBufferLike`\>[]

Mip levels, largest first.

##### premultiplied

`boolean`

Whether colour was multiplied by alpha when encoded. spryte draws premultiplied colour, so encode it that way.

#### Returns

`CompressedTexture`

## Properties

### format

> `readonly` **format**: [`CompressedFormat`](../type-aliases/CompressedFormat.md)

Defined in: spryte/dist/ktx2.d.ts:11

***

### height

> `readonly` **height**: `number`

Defined in: spryte/dist/ktx2.d.ts:10

***

### levels

> `readonly` **levels**: readonly `Uint8Array`\<`ArrayBufferLike`\>[]

Defined in: spryte/dist/ktx2.d.ts:13

Mip levels, largest first.

***

### premultiplied

> `readonly` **premultiplied**: `boolean`

Defined in: spryte/dist/ktx2.d.ts:15

Whether colour was multiplied by alpha when encoded. spryte draws premultiplied colour, so encode it that way.

***

### width

> `readonly` **width**: `number`

Defined in: spryte/dist/ktx2.d.ts:9
