ImageUtils

Common utilities for working with image data.

Static properties

impls: Record<string, ImageUtilsFormat>

Static methods

  • getChannels(buffer: Uint8Array, mimeType: string): number | null
  • Returns a conservative estimate of the number of channels in the image. For some image formats, the method may return 4 indicating the possibility of an alpha channel, without the ability to guarantee that an alpha channel is present.

  • extensionToMimeType(extension: string): string
  • getMimeType(buffer: Uint8Array): string | null
  • Returns detected MIME type of the given image buffer. Note that for image formats with support provided by extensions, the extension must be registered with an I/O class before it can be detected by ImageUtils.

  • mimeTypeToExtension(mimeType: string): string
  • getSize(buffer: Uint8Array, mimeType: string): vec2 | null
  • getVRAMByteLength(buffer: Uint8Array, mimeType: string): number | null
Function symbol, where the argument and output are a box labeled 'glTF'.

Made by Don McCurdy. Documentation built with greendoc and published under Creative Commons Attribution 3.0.