Options
All
  • Public
  • Public/Protected
  • All
Menu

Module image

Index

Type aliases

ImageFormat

ImageFormat: "jpg" | "jpeg" | "png" | "webp"

Variables

Const MAX_LEVEL_AUTO

MAX_LEVEL_AUTO: -1 = -1

Functions

decodeImage

  • decodeImage(base64: string, encoding?: BufferEncoding): Promise<Image>
  • Parameters

    • base64: string
    • encoding: BufferEncoding = 'base64'

    Returns Promise<Image>

decodeImageFromBuffer

  • decodeImageFromBuffer(buffer: Buffer): Promise<Image>
  • Parameters

    • buffer: Buffer

    Returns Promise<Image>

decodeImageFromBufferSync

  • decodeImageFromBufferSync(buffer: Buffer): Image
  • Parameters

    • buffer: Buffer

    Returns Image

decodeImageSync

  • decodeImageSync(base64: string, encoding?: BufferEncoding): Image
  • Parameters

    • base64: string
    • encoding: BufferEncoding = 'base64'

    Returns Image

encodeImage

  • encodeImage(img: Image, encoding?: BufferEncoding, format?: ImageFormat, quality?: number): Promise<string>
  • Parameters

    • img: Image
    • encoding: BufferEncoding = 'base64'
    • format: ImageFormat = 'png'
    • quality: number = 100

    Returns Promise<string>

encodeImageSync

  • encodeImageSync(img: Image, encoding?: BufferEncoding, format?: ImageFormat, quality?: number): string
  • Parameters

    • img: Image
    • encoding: BufferEncoding = 'base64'
    • format: ImageFormat = 'png'
    • quality: number = 100

    Returns string

encodeImageToBuffer

  • encodeImageToBuffer(img: Image, format?: ImageFormat, quality?: number): Promise<Buffer>
  • Parameters

    Returns Promise<Buffer>

encodeImageToBufferSync

  • encodeImageToBufferSync(img: Image, format?: ImageFormat, quality?: number): Buffer
  • Parameters

    Returns Buffer

findImage

findImageInRegion

  • findImageInRegion(src: Image, template: Image, x: number, y: number, width?: number, height?: number, threshold?: number): Promise<cv.Point2 | null>
  • Parameters

    • src: Image
    • template: Image
    • x: number
    • y: number
    • Optional width: number
    • Optional height: number
    • Optional threshold: number

    Returns Promise<cv.Point2 | null>

findImageInRegionSync

  • findImageInRegionSync(src: Image, template: Image, x: number, y: number, width?: number, height?: number, threshold?: number): Promise<cv.Point2 | null>
  • Parameters

    • src: Image
    • template: Image
    • x: number
    • y: number
    • Optional width: number
    • Optional height: number
    • Optional threshold: number

    Returns Promise<cv.Point2 | null>

findImageSync

loadImage

  • loadImage(url: string): Promise<Image>
  • Parameters

    • url: string

    Returns Promise<Image>

readImage

  • readImage(file: string): Promise<Image>
  • Parameters

    • file: string

    Returns Promise<Image>

readImageSync

  • readImageSync(file: string): Image
  • Parameters

    • file: string

    Returns Image

writeImage

  • writeImage(img: Image, file: string, quality?: number): Promise<void>
  • Parameters

    • img: Image
    • file: string
    • quality: number = 100

    Returns Promise<void>

writeImageSync

  • writeImageSync(img: Image, file: string, quality?: number): void
  • Parameters

    • img: Image
    • file: string
    • quality: number = 100

    Returns void

Generated using TypeDoc