1.0.1 • Published 3 years ago
react-native-pixel-image v1.0.1
react-native-pixel-image
Parse image file to ImageData for React Native
Installation
$ npm install react-native-pixel-imageFor RN >= 0.65, run npm install react-native-blob-util.
For RN < 0.65, run npm install react-native-blob-util@0.16.3, 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); //objectAPI
pixel(file) -> Promise<ImageData[]>
return images is Array contains one or more ImageData.
imagescan be resized and also keep property e.g.delaybyresizeImageDatasof 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).gifon Android,file:///private/var/mobile/Containers/.../foo.pngon 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