https://github.com/semibran/img-extract
:pick: tiny subimage extractor
https://github.com/semibran/img-extract
extract game image img sprite spritesheet subimage
Last synced: 3 months ago
JSON representation
:pick: tiny subimage extractor
- Host: GitHub
- URL: https://github.com/semibran/img-extract
- Owner: semibran
- License: mit
- Created: 2018-03-14T18:40:15.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-22T03:07:17.000Z (about 7 years ago)
- Last Synced: 2025-03-13T18:41:28.864Z (4 months ago)
- Topics: extract, game, image, img, sprite, spritesheet, subimage
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# img-extract
> tiny subimage extractor## usage
[![npm badge]][npm package]### `extract(image, x, y, width, height) -> canvas`
Extracts a `canvas` from the provided `image` and `x`, `y`, `width`, `height` region.* `image`: The source image of type [`CanvasImageSource`](CanvasImageSource)
* `x`: The x-coordinate offset of the subimage in pixels
* `y`: The y-coordinate offset of the subimage in pixels
* `width`: The width of the subimage in pixels
* `height`: The height of the subimage in pixels
* `canvas`: The subimage, of type `HTMLCanvasElement`[npm package]: https://www.npmjs.com/package/img-extract
[npm badge]: https://nodei.co/npm/img-extract.png?mini
[CanvasImageSource]: https://developer.mozilla.org/en-US/docs/Web/API/CanvasImageSource