@kaorun/large-imagedata
TypeScript icon, indicating that this package has built-in type declarations

0.0.7 • Public • Published

large-imagedata

Utility to get imageData of large size image not able to treat with canvas for pixel size limitation.

Installation

$ npm install @kaorun/large-imagedata

Import

import { LargeImageData } from @kaorun/large-imagedata;

Usage

constructor( size = 4096 )

Argument

  • size - canvas width and height to split image.

getImageData( value )

Get imageData of HTMLImageElement or ImageBitmap.

Argument

  • value - HTMLImageElement or ImageBitmap to get imageData.

Return

  • imageData - return HTMLImageElement.

    • width - source image width.
    • height - source image height.
    • data - rgba data array.

loadToImageElement( path )

Load image file to HTMLImageElement. Recommended.

Argument

  • path - path to image file.

Return

  • promise - resolve HTMLImageElement.

loadToImageBitmap( path )

Load image file to ImageBitmap.

Argument

  • path - path to image file.

Return

  • promise - resolve ImageBitmap.

License

MIT

Package Sidebar

Install

npm i @kaorun/large-imagedata

Weekly Downloads

1

Version

0.0.7

License

MIT

Unpacked Size

31.5 kB

Total Files

14

Last publish

Collaborators

  • kaorukitao