react-native-pixel-image
v1.0.1
Published
Parse image file to ImageData for React Native
Downloads
12
Maintainers
Readme
react-native-pixel-image
Parse image file to ImageData for React Native
Installation
$ npm install react-native-pixel-image
For RN >= 0.65, run npm install react-native-blob-util
.
For RN < 0.65, run npm install [email protected]
, and patch manually to fix: with react-native-web product build will export 'URIUtil' (reexported as 'URIUtil') was not found.
var pixel= require('react-native-pixel-image');
console.log(pixel); //object
API
pixel(file
) -> Promise<ImageData[]>
return images
is Array contains one or more ImageData
.
images
can be resized and also keep property e.g.delay
byresizeImageDatas
of react-native-pixel-util.
file
is...
- string: url (e.g.
http[s]://...
) - string: datauri (e.g.
data:image/...
which can comes from data-uri.macro) - string: path (e.g.
/storage/emulated/0/Pictures/gifs/ani (1).gif
on Android,file:///private/var/mobile/Containers/.../foo.png
on iOS) - string: binary (unless above)
- object: Blob/File
- object: Buffer/ArrayBuffer/Uint8Array/Uint8ClampedArray
- object: HTMLImageElement
Support
- gif (static/animation)
- png (static/animation)
- jpeg
- bitmap (32bit or less)
- webp (static/animation)
Related projects
- react-native-pixel-image
- react-native-pixel-util
- react-native-pixel-gif
- react-native-pixel-png
- react-native-pixel-jpg
- react-native-pixel-bmp
- react-native-pixel-webp
- pixel-to-ansi
- pixel-to-svg