All Projects → GregoryNative → React Native Gl Image Filters

GregoryNative / React Native Gl Image Filters

Licence: mit
React-Native image filters using gl-react

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Native Gl Image Filters

One Punch Fitness
A "One Punch Man"-inspired workout app!
Stars: ✭ 64 (-43.86%)
Mutual labels:  expo
Feature U
Feature Based Project Organization for React
Stars: ✭ 80 (-29.82%)
Mutual labels:  expo
Match Media
Universal polyfill for match media API using Expo APIs on mobile
Stars: ✭ 95 (-16.67%)
Mutual labels:  expo
Expo Tinder
A Tinder Clone using Expo & React Native Elements
Stars: ✭ 67 (-41.23%)
Mutual labels:  expo
Reactnativelaravellogin
Sample App for login using laravel 5.5 React Native and Redux
Stars: ✭ 75 (-34.21%)
Mutual labels:  expo
Reactconfbr App
React Conf BR App built with create-react-native-app
Stars: ✭ 84 (-26.32%)
Mutual labels:  expo
E Commerce App React Native
E-commerce App UI. React native, Expo managed flow, React navigation v5, Notification.
Stars: ✭ 61 (-46.49%)
Mutual labels:  expo
Playlist Example
Stars: ✭ 111 (-2.63%)
Mutual labels:  expo
Expo Three Demo
🍎👩‍🏫 Collection of Demos for THREE.js in Expo!
Stars: ✭ 76 (-33.33%)
Mutual labels:  expo
Sqlite Example
This example has moved
Stars: ✭ 91 (-20.18%)
Mutual labels:  expo
Snake
🐍🎮 Snake game made with Expo & PIXI.js 👾 iOS, Android, and Web
Stars: ✭ 67 (-41.23%)
Mutual labels:  expo
React Native Blockchain Poll
Source code of bringing-the-blockchain-to-react-native blog post.
Stars: ✭ 75 (-34.21%)
Mutual labels:  expo
Expo Boilerplate
React Native/Expo starting boilerplate with basic features (auth, tabs, i18n, redux, validation, notifications)
Stars: ✭ 88 (-22.81%)
Mutual labels:  expo
Lego Expo
Play with Lego bricks anywhere using Expo
Stars: ✭ 65 (-42.98%)
Mutual labels:  expo
Spectrum
Simple, powerful online communities.
Stars: ✭ 10,315 (+8948.25%)
Mutual labels:  expo
React Native Meme Generator
Add text on popular memes, save to camera roll. built with Expo.
Stars: ✭ 63 (-44.74%)
Mutual labels:  expo
React Native Bottomsheet Reanimated
React Native bottom sheet with fully native 60 FPS animations and awesome user experience
Stars: ✭ 80 (-29.82%)
Mutual labels:  expo
Eslint Config Universe
Moved to https://github.com/expo/expo/tree/master/packages/eslint-config-universe
Stars: ✭ 111 (-2.63%)
Mutual labels:  expo
Reactnativeauth
Mobile user authentication flow with React Native, Expo, and AWS Amplify: Sign In, Sign Up, Confirm Sign Up, Forget Password, Reset Password.
Stars: ✭ 108 (-5.26%)
Mutual labels:  expo
React Native Styled.macro
⚛️ A Utility-First Styling Library for React Native
Stars: ✭ 89 (-21.93%)
Mutual labels:  expo

icon react-native-gl-image-filters

react-native-gl-image-filters is released under the MIT license. Current npm package version. Current npm package downloads. Expo snack. Stackblitz project.

OpenGL bindings for React Native to implement complex effects over images and components, in the descriptive VDOM paradigm. You can use predefined filters:

  • blur
  • contrast
  • saturation
  • brightness
  • hue
  • negative
  • sepia
  • sharpen
  • temperature
  • exposure.

gl-react-native is an implementation of gl-react for react-native. Please read the main gl-react README and gl-react-native README for more information.

Table of Contents

API

Props

Props for ImageFilters Component

Name Description Type Required Default Value
children Inner component or url for image Any +
width Width of component Number +
height Height of component Number +
hue Hue filter Number 0
blur Blur filter Number 0
sepia Sepia filter Number 0
sharpen Sharpen filter Number 0
negative Negative filter Number 0
contrast Contrast filter Number 1
saturation Saturation filter Number 1
brightness Brightness filter Number 1
temperature Temperature filter Number 6500
exposure Exposure filter Number 0
🆕 colorOverlay Color Overlay with the length of 4 (RGBA format). Values must be a real value between 0 and 255. Array [0.0, 0.0, 0.0, 0.0]

Constants

DefaultValues

Can be used to set filter to default one manually.

interface DefaultValues {
  sepia: number;
  hue: number;
  blur: number;
  sharpen: number;
  negative: number;
  temperature: number;
  brightness: number;
  contrast: number;
  saturation: number;
  exposure: number;
  colorOverlay: Array<number>;
}
Usage example
import ImageFilters, { Constants } from 'react-native-gl-image-filters';

...

state = {
  blur: 4,
};

...

resetFilter = () => {
  this.setState({
    blur: Constants.DefaultValues.blur,
  });
}

DefaultPresets

Can be used to list available presets.

interface DefaultPresets extends Array<DefaultPreset> {}
interface DefaultPreset {
  name: string,
  description: string,
  preset: Preset,
}
interface Preset {
  sepia?: number;
  hue?: number;
  blur?: number;
  sharpen?: number;
  negative?: number;
  temperature?: number;
  brightness?: number;
  contrast?: number;
  saturation?: number;
  exposure?: number;
}
Usage example
import ImageFilters, { Constants } from 'react-native-gl-image-filters';

...

<>
  {Constants.DefaultPresets.map(item =>
    <View>
      <Text>{item.name}</Text>
      <Text>{item.description}</Text>
      <Surface>
        <ImageFilters {...item.preset}>
          {{ uri: 'https://i.imgur.com/5EOyTDQ.jpg' }}
        </ImageFilters>
       </Surface>
    </View>
  )}
</>

Presets

Use predefined presets.

import { Presets } from 'react-native-gl-image-filters';

Presets.NoPreset;
Presets.AmaroPreset;
Presets.ClarendonPreset;
Presets.DogpatchPreset;
Presets.GinghamPreset;
Presets.GinzaPreset;
Presets.HefePreset;
Presets.LudwigPreset;
Presets.SkylinePreset;
Presets.SlumberPreset;
Presets.SierraPreset;
Presets.StinsonPreset;

...

<ImageFilters {...Presets.StinsonPreset}>
  {{ uri: 'https://i.imgur.com/5EOyTDQ.jpg' }}
</ImageFilters>

Utils

createPreset

Available for creating own presets.

import ImageFilters, { Utils } from 'react-native-gl-image-filters';

const MyOwnPreset = Utils.createPreset({
  brightness: .1,
  saturation: -.5,
  sepia: .15,
});

...

<ImageFilters {...MyOwnPreset}>
  {{ uri: 'https://i.imgur.com/5EOyTDQ.jpg' }}
</ImageFilters>

Recommended Min and Max range for each filter

Name Min. Value Max. Value
hue 0 6.3
blur 0 30
sepia -5 5
sharpen 0 15
negative -2 2
contrast -10 10
saturation 0 2
brightness 0 5
temperature 0 40000
exposure -1 1

Installation

Installation for React Native

npm i --save react-native-gl-image-filters
npm i --save [email protected]^4.0.1
npm i --save [email protected]^4.0.1
npm i --save [email protected]^5.4.3
npm i --save [email protected]^0.7.0

or

yarn add react-native-gl-image-filters
yarn add [email protected]^4.0.1
yarn add [email protected]^4.0.1
yarn add [email protected]^5.4.3
yarn add [email protected]^0.7.0

Configure your React Native Application

on iOS:

https://github.com/unimodules/react-native-unimodules#-configure-ios

on Android:

https://github.com/unimodules/react-native-unimodules#-configure-android

Installation on Expo

npm i --save react-native-gl-image-filters
npm i --save expo-gl
npm i --save [email protected]^4.0.1
npm i --save [email protected]^4.0.1
npm i --save [email protected]^5.4.3

or

yarn add react-native-gl-image-filters
yarn add expo-gl
yarn add [email protected]^4.0.1
yarn add [email protected]^4.0.1
yarn add [email protected]^5.4.3

Installation on React Web

npm i --save react-native-gl-image-filters
npm i --save [email protected]^4.0.1
npm i --save [email protected]^4.0.1

or

yarn add react-native-gl-image-filters
yarn add [email protected]^4.0.1
yarn add [email protected]^4.0.1

Usage

Usage with React Native

Example here: examples/react-native

Usage with Expo

Snack: https://snack.expo.io/@gregoryrn/expo-gregorynative-react-native-gl-image-filters
Example here: examples/expo

Usage with React web

Blitz: https://stackblitz.com/edit/react-native-gl-image-filters-web-example
Example here: examples/web

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].