# Image Cropping image cropping samples

### Jcrop Image Cropping Plugin

Jcrop is the quick and easy way to add image cropping functionality to your web application. It combines the ease-of-use of a typical jQuery plugin with a powerful cross-platform DHTML cropping engine that is faithful to familiar desktop graphics applications.

For more info please check out the official documentation

Editable Form
Actions Settings

#### This example demonstrates the default behavior of Jcrop.

Since no event handlers have been attached it only performs the cropping behavior.

#### An example with a basic event handler.

Here we've tied several form values together with a simple event handler invocation. The result is that the form values are updated in real-time as the selection is changed using Jcrop's onChange handler.

#### Cropped Image Details:

X1 |
Y1 |
X2 |
Y2 |
Width |
Height |

#### An example implementing a preview pane.

Obviously the most visual demo, the preview pane is accomplished entirely outside of Jcrop with a simple jQuery-flavored callback. This type of interface could be useful for creating a thumbnail or avatar. The onChange event handler is used to update the view in the preview pane.

#### Experimental shader active.

Jcrop now includes a shading mode that facilitates building better transparent Jcrop instances. The experimental shader is less robust than Jcrop's default shading method and should only be used if you require this functionality.

#### Animation/Transitions.

Demonstration of animateTo API method and transitions for bgColor and bgOpacity options. Color fading requires inclusion of John Resig's jQuery Color Animations plugin. If it is not included, colors will not fade.
Enable fading (bgFade: true) Use experimental shader (shade: true)

### Realtime API

#### Option Toggles

Aspect ratio minSize/maxSize setting Allow new selections Selection can be moved Resizable selection

#### Change Image

#### Manipulate classes

Example styling tricks. Click the buttons above to change the appearance of Jcrop in real-time.

This is an example of attaching Jcrop to a target that is not an image. You are now cropping a paragraph tag.

#### Attaching Jcrop to a non-image element.

This is mostly useful to implement other interfaces, such as `canvas` or over an arbitrary `div`.

#### An example server-side crop script.

Hidden form values are set when a selection is made. If you press the Crop Image button, the form will be submitted and a 150x150 thumbnail will be dumped to the browser. Try it!