LogoPixi’VN
pixi-jsType aliases

Type Alias: ExtractOptions

> ExtractOptions = BaseExtractOptions | ExtractImageOptions | ExtractDownloadOptions

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/extract/ExtractSystem.d.ts:352

Options for extracting content from a renderer. Represents a union of all possible extraction option types. Used by various extraction methods to support different output formats and configurations.

Example

// Basic canvas extraction
const canvas = renderer.extract.canvas({
    target: sprite
});

// Image extraction with format
const image = await renderer.extract.image({
    target: sprite,
    format: 'png',
    quality: 1
});

// Download with filename
renderer.extract.download({
    target: sprite,
    filename: 'screenshot.png'
});

// Advanced extraction with multiple options
const image = await renderer.extract.image({
    target: container,
    frame: new Rectangle(0, 0, 100, 100),
    resolution: 2,
    clearColor: '#ff0000',
    antialias: true,
    format: 'webp',
    quality: 0.8
});

Supports three types of options:

Common use cases:

  • Extracting raw pixels
  • Creating canvas elements
  • Generating downloadable images
  • Taking screenshots
  • Creating thumbnails

See

Advanced