@kaorun/large-imagedata
v0.0.7
Published
Utility to get imageData of large pixel sized image file.
Downloads
19
Maintainers
Readme
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.