Skip to content

Ibrahimrahhal/react-image-curves-editor

Repository files navigation

react-image-curves-editor

React components to manipulate images curves like within photoshop

NPMJavaScript Style Guide

Install

npm install --save react-image-curves-editor

Example

https://ibrahimrahhal.github.io/react-image-curves-editor/

Usage

import{useEffect}from'react'import{ImageCurvesEditor,ImageLevelsHistogram}from'react-image-curves-editor'import'react-image-curves-editor/dist/index.css'constExample=()=>{constcanvasRef=React.useRef<HTMLCanvasElement>(null);const[loaded,setLoaded]=React.useState(false);useEffect(()=>{if(!canvasRef.current)return;constcanvas=canvasRef.current;constctx=canvas.getContext('2d');if(!ctx)return;constimg=newImage();img.onload=()=>{canvas.width=img.width;canvas.height=img.height;ctx.drawImage(img,0,0);setLoaded(true);};img.src='/house.jpg';},[])return(<div><canvasref={canvasRef}></canvas>{loaded&&<ImageLevelsHistogramtargetRef={canvasRef.current}/>}{loaded&&<ImageCurvesEditortargetCanvas={canvasRef.current}/>}</div>)}

License

MIT © ibrahimrahhal

About

React components to manipulate images curves like within photoshop

Topics

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •