Image editor for jQuery File Uploader
Editing images right in a browser is the closest path for your app to receive better images. And those, in turn, provide higher engagement rates and conversions. The quality of visuals becomes an even greater concern when you want to perfect images sent by your users before they get to your site or app.
Uploadcare features a custom tab for the jQuery File Uploader that allows enhancing and editing images in any browser, mobile included. The tab is called Effects Tab.
There are nine on-the-fly effects you can apply right in the uploading widget UI: crop, rotate, enhance, sharpen, blur, mirror, flip, grayscale, and invert.
You can configure which effects are enabled and change the tab behavior in other ways.
How it works
Image operations available for applying in the uploading widget dialog are based on our image processing operations. Effects Tab outputs a CDN URL holding image [UUIDs and operations applied by a user while editing in form of URL directives.
Technically, every image first gets to your Uploadcare project. Then we show an image preview in the uploading widget dialog via a CDN URL provided on file upload. When a user applies image processing operations, we inject the corresponding URL directives. Once the editing is complete, Effect Tab outputs the new CDN URL which includes all the applied operations.
For example, if a user chose to apply grayscale
and clicked rotate
once,
here is what we will get in the output:
Note the preview
operation will appear in the output URL by default due to
the image processing operation limitations.
Requirements
In-browser image editing is carried out via a custom uploading widget tab called Effects Tab.
The only requirement is integrating the uploading widget before using Effects Tab.
Install
Choose from the install methods listed below.
NPM
Get Effects Tab:
Import the tab it in your module:
CDN
You can either install the minified Effects Tab version:
Or go with a bundled version without minification:
Usage
Start using Effects Tab by adding it to your uploading widget:
Configuration
There are multiple ways to configure the set of effects enabled in Effects Tab.
Global Variables
You can either go with a string holding coma-separated effect names:
or use another approach:
Local Attributes
The set of enabled effects for a specific uploading widget instance can be controlled
via the data-effects
attribute.
Settings Object
Following the uploading widget concept, the allowed effects can be provided as the
settings
object.
or
Options
Effects string|array
Global: UPLOADCARE_EFFECTS
Local: data-effects
Object key: effects
Default value: crop,rotate,enhance,sharp,grayscale
.
This allows you to configure the set of enabled effects. It also controls
the order of effects in the tab: however, crop
will always placed first in
the set.
effects
can either be a string holding one or more comma-separated effects or
an array of strings, JS only. You can also enable all effects
by setting the option to all
.
Available effects:
crop
, crops images freely or using set aspect ratiosrotate
, rotates imagesmirror
, provides image-mirroring capabilitiesflip
, allows flipping imagesblur
, filters images via Gaussian Blursharp
, allows adjusting image sharpnessenhance
, makes images look better via auto levels, auto contrast, and saturation sharpeninggrayscale
, desaturates imagesinvert
, inverts image colors
Localization
You can choose one of the existing tab locales or contribute a new one. This can be done by forking the main repository followed by adding a new localization file to the list.