https://github.com/kishorjena/react-native-image-file-transformer
Scale, Convert & Compress animated & static image files. Supports It works with image files rather view and let's you use the transofmred image files.
https://github.com/kishorjena/react-native-image-file-transformer
animated-gif animated-webp compress convert encoder-decoder image image-file image-resizer react-native resize scale
Last synced: about 1 month ago
JSON representation
Scale, Convert & Compress animated & static image files. Supports It works with image files rather view and let's you use the transofmred image files.
- Host: GitHub
- URL: https://github.com/kishorjena/react-native-image-file-transformer
- Owner: KishorJena
- License: mit
- Created: 2024-02-07T19:28:42.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-09-07T08:04:35.000Z (9 months ago)
- Last Synced: 2025-10-10T11:24:08.932Z (8 months ago)
- Topics: animated-gif, animated-webp, compress, convert, encoder-decoder, image, image-file, image-resizer, react-native, resize, scale
- Language: Java
- Homepage: https://github.com/KishorJena/react-native-image-file-transformer
- Size: 1.36 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# React Bative Image File Transformer
## convert, compress, scale any animated or static image

[](https://badge.fury.io/js/react-native-image-file-transformer)
`react-native-image-file-transformer` is a React Native module that provides functionality for transforming and manipulating image files.
Platform support:
- [x] Android
- [ ] ios
## Installation
```sh
npm install react-native-image-file-transformer
```
## Usage
Import:
```js
import { Transform } from 'react-native-image-file-transformer';
```
Operations:
```js
await Transform.static([uri2, uri2,... ], options);
await Transform.animated([uri1, uri2,... ], options);
```
Constants:
```js
ScaleMode:
Transform.ScaleMode.CROP
Transform.ScaleMode.STRETCH
Transform.ScaleMode.FIT_CENTER
FormatType:
Transform.FormatType.JPEG
Transform.FormatType.PNG
Transform.FormatType.WEBP
Transform.FormatType.GIF
Transform.FormatType.AWEBP
Transform.FormatType.UNKNOWN
```
Misc:
```js
await Transform.getImageType([uri1, uri2, ...])
// Output
//[{"extention": "png", "isAnimated": false, "type": "PNG_A", "uri": "/storage/emulated/..."}]
```
```js
await Transform.clearCache()
```
## Example:
```js
Transform.animated(uris, {
width:100, // default will be taken from image
height:100, // default will be taken from image
quality:70, // default 100
scaleMode:Transform.ScaleMode.FIT_CENTER, // default FIT_CENTER
targetFormat:Transform.FormatType.AWEBP, // default JPGE/GIF
// minDelay:80, (ms)
// maxDelay:1000, (ms)
// parentDir:"storage/emulated/0/Download/output"
})
.then(r=>{log(r)})
.catch(e=>{log('error ',e)})
```
## Contribution
If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on the project's GitHub repository. [CONTRIBUTING.md](CONTRIBUTING.md)
### Contact on:
X (twitter) : x.com/KishorJena01
## License
[LICENSE](LICENSE)