An open API service indexing awesome lists of open source software.

https://github.com/nitin42/react-tint

A React component that applies image processing filters to an image using Processing
https://github.com/nitin42/react-tint

canvas image-processing p2d processing processingjs react web webgl

Last synced: 3 months ago
JSON representation

A React component that applies image processing filters to an image using Processing

Awesome Lists containing this project

README

        

# react-tint

![size-label](https://img.shields.io/badge/size-4.3%20KB-brightgreen.svg)

> A React component that applies image processing filters to an image using Processing

## Install

```
yarn add react-tint
```

This package also depends on React, so make sure you've already installed it.

## Usage

`react-tint` exposes only a single component, ``, that takes [different props]() as filters and an image, and applies them and returns a new canvas.

```js
import React, { Component } from 'react'
import ImageTint from 'react-tint'

class App extends Component {
render() {
return (

)
}
}
```

## API

### ImageTint

A component that applies image processing filters using Processing.

#### Props

* **`canvas`**

`canvas` prop takes an object with three properties - `height`, `width` and a `renderer` type.

Example -

```js

```

Two types of renderers are supported, **WEBGL** and **P2D**.

The P2D renderer uses OpenGL for faster rendering of two-dimensional graphics but at the expense of speed.

* **`tint`**

`tint` takes different types of data for an image. It can take a simple **string of color name**, **array of values** that includes Red, Green, Blue and alpha value for image transparency and **an object that describes color and alpha channel**.

Example -

**Color name**

```js

```

**Array of values**

```js

```

This array corresponds to => `[RED, GREEN, BLUE, ALPHA]`

**Object describing color and alpha value**

```js