4.8.1 • Published 6 months ago

filerobot-image-editor v4.8.1

Weekly downloads
1,602
License
MIT
Repository
github
Last release
6 months ago

Repository includes React version and Vanilla JS adapter for standalone usage

Release Contributions welcome License Scaleflex team

Tweet

Table of contents

Features

Adjust

brightness, contrast, exposure, and saturation

Effects

'edge enhance', 'emboss', 'grungy', 'hazy', 'lomo', 'radial blur', 'sin city', 'tilt shift'

Filters

'cross process', 'glow sun', 'jarques', 'love', 'old boot', 'orange peel', 'pin hole', 'sepia', 'sun rise', 'vintage'

Orientation

rotate and flip (mirrow effect)

Crop

Resize

Watermark

Light theme

or use your custom color scheme

Standalone usage

Installation

Use latest CDNized plugin version

<script src="https://cdn.scaleflex.it/plugins/filerobot-image-editor/3.7.7/filerobot-image-editor.min.js"></script>

Quick start

We provide easy way to integrate image editor in your applications

<script>
    const ImageEditor = new FilerobotImageEditor();

    ImageEditor.open('https://scaleflex.airstore.io/demo/stephen-walker-unsplash.jpg');
</script>

Methods

FilerobotImageEditor(config: {}, uploadHandler: callback): function

Initialization of Filerobot Image Editor plugin.

ImageEditor.open(url): function

Open editor modal.

  • url: string (required) - image url to edit

ImageEditor.close(): function

Close editor modal.

ImageEditor.unmount(): function

Destroy editor

React component usage

Installation

$ npm install --save filerobot-image-editor

Quick start

We provide easy way to integrate image editor in your applications

import React, { useState } from 'react';
import { render } from 'react-dom';
import FilerobotImageEditor from 'filerobot-image-editor';


const App = () => {
  const src = 'https://scaleflex.airstore.io/demo/stephen-walker-unsplash.jpg';
  const [show, toggle] = useState(false);


  return (
    <div>
      <h1>Filerobot Image Editor</h1>

      <img src={src} onClick={() => { toggle(true) }} alt="example image"/>

      <FilerobotImageEditor
        show={show}
        src={src}
        onClose={() => { toggle(false) }}
      />
    </div>
  )
};

render(<App/>, document.getElementById('app'));

Methods/Properties

show: bool (required)

default: false

Trigger, to display the image editor widget.

config: object

Image editor config.

onClose(): function (required)

Callback, triggers on close image editor widget.

onComplete(): function (required)

Callback, triggers on complete processing image.

Configuration

tools: string

default: 'adjust', 'effects', 'filters', 'rotate', 'crop', 'resize', 'watermark'

Filerobot Image Editor tools.

config.tools = ['adjust', 'effects', 'filters', 'rotate'];

isLowQualityPreview: bool

default: true

Helps to improve performance of the Image Editor by applying transformations to low quality preview.

config.isLowQualityPreview = true;

language: string

default: 'en'

Language of interface

available languages: en (fr, de, ru are in progress), you can add translations by yourself

config.language = 'en';

translations: object

key/translation pairs for i18n

config.translations = {
  en: {
    'toolbar.save': 'Save',
    'toolbar.apply': 'Apply',
    ...
  }
};

See all translation keys here

reduceBeforeEdit: object

In order to improve performance of editing your images, you can reduce the image size before editing.

default: mode: 'manual', widthLimit: 2000px, heightLimit: 2000px

config.reduceBeforeEdit = {
    mode: 'manual',
    widthLimit: 2000,
    heightLimit: 2000
  };
reduceBeforeEdit.mode: string | 'manual', 'auto' - Manual mode will show a modal before editing where you can reduce size of the image. Auto mode will reduce the image in the background (saving image proportion).
reduceBeforeEdit.widthLimit: number - Limit of the image width
reduceBeforeEdit.heightLimit: number - Limit of the image height

watermark: object

Add watermark on the image after applying image transformations.

default: null

watermark.url: string - url of the logo/image
watermark.urls: url|{ url, label } - list of url of the logo/image preset to select from in editor
watermark.position: string | 'center' - position of the watermark
watermark.opacity: number | 0-1 - opacity of the watermark
watermark.applyByDefault: bool - apply by default
watermark.activePositions: string - 'corners', 'star', 'center', 'top-row', 'center-row', 'bottom-row' - select a preset or apply an array with 9 positons 1,1,1,1,1,1,1,1,1
watermark.handleOpacity: boolean - default is true, hide or show the opacity range
watermark.imageFilter: function - default is null, pass a function that gets the image resource before draw and return a manipulated image (pass some fancy filter on the watermark)
config.watermark = {
    url: 'https://jolipage002-global.api.airstore.io/v1/get/_/04e725a5-8605-57d5-bf9b-b161745e7720/6d3f41ddc2c1271cb4fede2b7cc8323bec97a3c69f89fd1dd881c5bb9460d9c6.png',
    position: 'center',
    opacity: 0.7
  };

colorScheme: string | 'dark', 'light'

default: 'dark'

Color schemes, currently available two themes: 'dark', 'light'. There is possibility to make your custom theme here

theme: object

Possibility to make your custom theme See the example here

example:

config.theme = {
  colors: {
    primaryBg: '#1e262c',
    primaryBgHover: '#637381',
    secondaryBg: '#263138',
    secondaryBgHover: '#34444c',
    text: '#F9FAFB',
    textHover: '#fff',
    textMute: '#aaa',
    textWarn: '#f7931e',
    secondaryBgOpacity: 'rgba(0, 0, 0, 0.75)',

    border: '#161e23',
    borderLight: '#70777f'
  }
};

cropPresets: object

Add custom templates for crop. See the example here

resizePresets: object

Add custom templates for resize. See the example here

Filerobot Integration

Upload the image in your Filerobot storage container, edit it in the Image Editor and upload the result. Deliver lightning fast over CDN.

The example of Image Editor configuration using Filerobot service can be found here.

Learn more about Filerobot

Cloudimage Integration

Point the Image Editor to your origin image URL, edit it and deliver the result lightning fast over the Cloudimage image CDN. Limited to the Cloudimage inline transformation features.

The example of Image Editor configuration using cloudimage service can be found here.

Learn more about Cloudimage

What's on the Roadmap for the near future

Features

  • Control image brightness, contrast, exposure, and saturation (done in v3.0.0)
  • Bright theme, plus possibility to make your custom theme (done in v3.0.0)
  • Rounds the corners of images
  • Mirror images effect (done in v3.0.0)
  • New filters and effects
  • Load file objects and dataURLs
  • Transform input images to other image formats
  • Easily integrate with third party libraries
  • Compress JPEG images via Optipress
  • Set to preview mode to render on top of an existing image
  • Watermarking (done in v3.0.0)
  • Configurable resize/crop templates (done in v3.0.0)
  • Correct degree of an image (done in v3.0.0)

Adapters

  • Vanilla JS (done)
  • React (done)
  • Angular
  • Vue
  • Web Component

Filerobot UI Familiy

Contributing!

All contributions are super welcome!

License

Filerobot Image Editor is provided under the MIT License

5.0.0-beta.0

6 months ago

5.0.0

6 months ago

4.8.1

6 months ago

4.8.0

6 months ago

4.7.0

11 months ago

4.6.1

12 months ago

4.6.0

12 months ago

4.5.2

1 year ago

4.6.0-beta.0

1 year ago

4.5.1

1 year ago

4.5.0

1 year ago

4.4.0

2 years ago

4.3.8

2 years ago

4.3.2

2 years ago

4.3.7

2 years ago

4.2.1-beta.20

2 years ago

4.2.1-beta.21

2 years ago

4.2.1-beta.22

2 years ago

4.2.1-beta.23

2 years ago

4.2.1-beta.10

2 years ago

4.2.1-beta.11

2 years ago

4.2.1-beta.12

2 years ago

4.2.1-beta.13

2 years ago

4.2.1-beta.14

2 years ago

4.2.1-beta.15

2 years ago

4.2.1-beta.16

2 years ago

4.2.1-beta.17

2 years ago

4.2.1-beta.18

2 years ago

4.2.1-beta.19

2 years ago

4.3.1

2 years ago

4.3.0

2 years ago

4.2.1-beta.7

2 years ago

4.2.1-beta.6

2 years ago

4.2.1-beta.5

2 years ago

4.2.1-beta.4

2 years ago

4.2.1-beta.9

2 years ago

4.2.1-beta.8

2 years ago

4.2.1-beta.3

2 years ago

4.2.1-beta.2

2 years ago

4.2.1-beta.1

2 years ago

4.2.1-beta.0

2 years ago

4.2.1

2 years ago

4.2.0

3 years ago

4.0.0

3 years ago

4.0.0-beta.43

3 years ago

4.0.0-beta.40

3 years ago

4.0.0-beta.41

3 years ago

4.0.0-beta.37

3 years ago

4.0.0-beta.36

3 years ago

4.0.0-beta.39

3 years ago

4.0.0-beta.38

3 years ago

4.0.0-beta.35

3 years ago

4.0.0-beta.34

3 years ago

4.1.0

3 years ago

4.1.1

3 years ago

4.0.0-beta.33

3 years ago

4.0.0-beta.32

3 years ago

4.0.0-beta.31

3 years ago

4.0.0-beta.30

3 years ago

4.0.0-beta.26

3 years ago

4.0.0-beta.25

3 years ago

4.0.0-beta.28

3 years ago

4.0.0-beta.27

3 years ago

4.0.0-beta.22

3 years ago

4.0.0-beta.21

3 years ago

4.0.0-beta.24

3 years ago

4.0.0-beta.23

3 years ago

4.0.0-beta.20

3 years ago

4.0.0-beta.29

3 years ago

4.0.0-beta.15

3 years ago

4.0.0-beta.14

3 years ago

4.0.0-beta.17

3 years ago

4.0.0-beta.16

3 years ago

4.0.0-beta.11

3 years ago

4.0.0-beta.10

3 years ago

4.0.0-beta.12

3 years ago

4.0.0-beta.19

3 years ago

4.0.0-beta.18

3 years ago

4.0.0-beta.8

3 years ago

4.0.0-beta.7

3 years ago

4.0.0-beta.6

3 years ago

4.0.0-beta.5

3 years ago

4.0.0-beta.4

3 years ago

4.0.0-beta.3

3 years ago

4.0.0-beta.2

3 years ago

4.0.0-beta.1

3 years ago

4.0.0-beta.9

3 years ago

3.12.17

4 years ago

3.12.16

4 years ago

3.12.15

4 years ago

3.12.14

4 years ago

3.12.13

4 years ago

3.12.12

4 years ago

3.12.12-beta.15

4 years ago

3.12.12-beta.14

4 years ago

3.12.12-beta.13

4 years ago

3.12.12-beta.12

4 years ago

3.12.12-beta.11

4 years ago

3.12.12-beta.10

4 years ago

3.12.12-beta.9

4 years ago

3.12.12-beta.8

4 years ago

3.12.12-beta.7

4 years ago

3.12.12-beta.6

4 years ago

3.12.12-beta.5

4 years ago

3.12.12-beta.4

4 years ago

3.12.12-beta.2

4 years ago

3.12.12-beta.3

4 years ago

3.12.12-beta.0

4 years ago

3.12.12-beta.1

4 years ago

3.12.11

4 years ago

3.12.10

4 years ago

3.12.9

4 years ago

3.12.8

4 years ago

3.12.8-beta.0

4 years ago

3.12.8-beta.1

4 years ago

3.12.6-beta.3

4 years ago

3.12.6-beta.2

4 years ago

3.12.6-beta.1

4 years ago

3.12.6-beta.0

4 years ago

3.12.7

4 years ago

3.12.6

4 years ago

3.12.5

4 years ago

3.12.4

4 years ago

3.12.4-beta.0

4 years ago

3.12.3-beta.7

4 years ago

3.12.3

4 years ago

3.12.3-beta.6

4 years ago

3.12.3-beta.5

4 years ago

3.12.3-beta.4

4 years ago

3.12.3-beta.3

4 years ago

3.12.3-beta.2

4 years ago

3.12.3-beta.1

4 years ago

3.12.2

4 years ago

3.12.1

4 years ago

3.12.0

4 years ago

3.11.5

4 years ago

3.11.4

4 years ago

3.11.3

4 years ago

3.11.2

4 years ago

3.11.1

4 years ago

3.11.0

4 years ago

3.10.1

4 years ago

3.10.0

4 years ago

3.9.6

4 years ago

3.9.5-beta.0

4 years ago

3.9.5

4 years ago

3.9.4

4 years ago

3.9.3

4 years ago

3.9.2

4 years ago

3.9.1

4 years ago

3.9.0

4 years ago

3.8.0

4 years ago

3.8.2

4 years ago

3.8.1

4 years ago

3.7.8-beta.0

4 years ago

3.7.7

5 years ago

3.7.6

5 years ago

3.7.5

5 years ago

3.7.4

5 years ago

3.7.3

5 years ago

3.7.2

5 years ago

3.7.1

5 years ago

3.7.0

5 years ago

3.6.6

5 years ago

3.6.5

5 years ago

3.6.4

5 years ago

3.6.3

5 years ago

3.6.2

5 years ago

3.6.1

5 years ago

3.6.0

5 years ago

3.5.0

5 years ago

3.4.2

5 years ago

3.4.1

5 years ago

3.4.0

5 years ago

3.3.0

5 years ago

3.2.1

5 years ago

3.2.0

5 years ago

3.1.1

5 years ago

3.1.0

5 years ago

3.0.4

5 years ago

3.0.3

5 years ago

3.0.2

5 years ago

3.0.1

5 years ago

2.1.0

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

1.2.1

5 years ago

1.2.0

6 years ago

1.1.9

6 years ago

1.1.8

6 years ago

1.1.7

6 years ago

1.1.6

6 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago