https://github.com/bhoodream/react-image-parser
React image parser component
https://github.com/bhoodream/react-image-parser
colors image parser react size
Last synced: 2 months ago
JSON representation
React image parser component
- Host: GitHub
- URL: https://github.com/bhoodream/react-image-parser
- Owner: bhoodream
- Created: 2018-01-18T07:49:35.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-11-03T15:34:42.000Z (over 7 years ago)
- Last Synced: 2025-10-05T00:18:46.819Z (9 months ago)
- Topics: colors, image, parser, react, size
- Language: JavaScript
- Homepage: https://vadimfedorov.ru/lab/react-image-parser/
- Size: 119 KB
- Stars: 0
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# React-Image-Parser
With this component you can easily parse the image.
#### Features:
- get image data;
- get image size.
#### Install:
```bash
npm i react-image-parser
```
#### Add:
```javascript
import ImageParser from 'react-image-parser';
```
#### Use:
```javascript
console.log(data)}
/>
```
#### Props:
| Name | Type | Required | Default | Description |
|:------------|:---------------|:----------|:---------|:-------------|
| img | String | Yes | null | Path to image. For example, './my/image/path.png' |
| maxImgSideSize | Number | No | bigger side of image | The maximum size of the sides of the canvas on which the image will be parsed. |
| onImageParsed | Function | No | null | The function in which the image parsing result will be passed. |
#### Result Structure:
```
{
data: Uint8ClampedArray(64) [255, 202, 0, 134, 205, 159...], // image data
size: { width: 100, height: 200 } // image size
}
```
#### Demo:
For more information and examples check the [demo page](https://vadimfedorov.ru/lab/react-image-parser/).