Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork0
Compress, Optimize and Manipulate GIF in React Native 🚀✨
License
numandev1/react-native-gifsicle
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
REACT-NATIVE-GIFSICLE is a react-native package, which helps us toCompress,Optimize andManipulate Gif, It is a usingGifsicle under the hood
Open Table of Contents
yarn add react-native-gifsicle
You can give feedback onDiscord channel
expo install react-native-gifsicleAdd the Gifsicle plugin to your Expo config (app.json,app.config.json orapp.config.js):
{"name":"my app","plugins": ["react-native-gifsicle"]}Finally, compile the mods:
expo prebuildimportRNGifsiclefrom'react-native-gifsicle';constmanipulatedUri=awaitRNGifsicle.compressGif(uri,{lossy:100,colors:250,// scale_x: 2,// scale_y: 2,// optimize:3// height: 250,// width: 300,});
Install the package:
yarn add react-native-gifsicleLink the library:
(Note: For React Native 0.60 or greater,autolinking is available)
or later. For earlier versions you need to manually link the module.)
react-native link react-native-gifsicleif cocoapods are used in the project then pod has to be installed as well:
(cd ios; pod install)Manual Link (iOS)
- In XCode, in the project navigator, right click
Libraries➜Add Files to [your project's name] - Go to
node_modules➜react-native-gifsicleand addGifsicle.xcodeproj - Expand the
Gifsicle.xcodeproj➜Productsfolder - In the project navigator, select your project. Add
Gifsicle.ato your project'sBuild Phases➜Link Binary With Libraries - And go the Build Settings tab. Make sure All is toggled on (instead of Basic)
- Look for Header Search Paths and add
$(SRCROOT)/../node_modules/react-native-gifsicle/ios/**asnon-recursive
- In XCode, in the project navigator, right click
Compresses a GIF located at the specified URI using the provided options.
uri(string): The URI of the GIF to compress.options(object): The options for compression. Available options are:lossy(number): Alter image colors to shrink output file size at the cost of artifacts and noise.default=200range[0-200]optimize(number): Optimize output GIFs.default=3range[1-3]colors(number): Reduce the number of colors to N.default=255rage [0-255]scale_x(number): Scale the image in the x-axis.scale_y(number): Scale the image in the y-axis.height(number): Resize the output GIF height.width(number): Resize the output GIF width.
- A Promise that resolves to a URI of the compressed GIF.
Consider supporting with a ⭐️star on GitHub
If you are using the library in one of your projects, consider supporting it with a star. It takes a lot of time and effort to keep this maintained and address issues and bugs. Thank you.
About
Compress, Optimize and Manipulate GIF in React Native 🚀✨
Topics
Resources
License
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
Uh oh!
There was an error while loading.Please reload this page.

