0.0.7 • Published 1 year ago

@kaorun/large-imagedata v0.0.7

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

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

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago