Skip to content

Image pre-processing (colour to grayscale) library for e-paper

License

Notifications You must be signed in to change notification settings

huming2207/epaperify

Repository files navigation

ePaperify

Framebuffer/image pre-processing library for e-Paper displays

Usage

export function to4Bpp(
  image: Buffer,
  format?: string | undefined | null,
  signal?: AbortSignal | undefined | null,
): Promise<Buffer>

Converts any image to 4-bit-per-pixel grayscale, with dithering to emulate 8-bit-per-pixel

  • Parameters:
    • image: image buffer, can be any image format supported by Rust image library, e.g. PNG, JPG, TIFF, WebP...
    • format: format string, e.g. "png", "jpg"; by default it's "png"
    • signal: signal of AbortController
export function toMonochrome(
  image: Buffer,
  format?: string | undefined | null,
  signal?: AbortSignal | undefined | null,
): Promise<Buffer>

Converts any image to 1-bit-per-pixel grayscale, with dithering to emulate 8-bit-per-pixel

  • Parameters:
    • image: image buffer, can be any image format supported by Rust image library, e.g. PNG, JPG, TIFF, WebP...
    • format: format string, e.g. "png", "jpg"; by default it's "png"
    • signal: signal of AbortController