Chevron DownCommand-Line Reference
Chevron DownAPI Reference

CompressedTextureWriter

From-v3.0 Node.js-only

The experimental CompressedTextureWriter class can encode a binary encoded image into a compressed texture.

LoaderCharacteristic
File Extension
File TypeBinary
Data Format
File Format
Encoder TypeAsynchronous
Worker ThreadNo (but may run on separate native thread in browsers)
StreamingNo

Usage

import '@loaders.gl/polyfill'; // only if using under Node
import {encodeURLtoURL} from '@loaders.gl/core';
import {CompressedTextureWriter} from '@loaders.gl/textures';

export const IMAGE_URL = 'image.png';

const outputFilename = await encodeURLtoURL(IMAGE_URL, '/tmp/test.ktx', CompressedTextureWriter);

// app can now read the file from outputFilename

Data Format

TBA

Options

OptionTypeDefaultDescription

Remarks