Skip to main content
Let people crop and adjust an image before saving it. The editor works with newly uploaded images and existing images owned by the field. It reads the original image, even when the upload list displays a smaller conversion.

Enable the editor

The image’s actions include Edit image. The user opens the editor, makes changes and applies them. FLEX creates a replacement upload; the usual form save stores it using the field’s existing persistence settings. Closing the editor without applying discards its unsaved editing changes. No extra JavaScript installation or application build is needed. The package ships the editor assets; its crop geometry module loads when editing is opened. Ordinary upload fields do not initialize an image editor.

What users can change

The Crop view provides a movable crop area, free cropping, configured aspect ratios, rotation in 90° steps, horizontal/vertical flipping and reset. Scrolling over the image zooms the crop workspace. The adjustment controls include brightness, warmth, contrast, exposure, highlights, shadows, fade, saturation, vibrance, clarity, sharpness and vignette. Adjustment values apply to the exported image, rather than adding a CSS filter to its saved preview. The editor provides its own controls; there is currently no PHP option for supplying an arbitrary list of adjustment tools or an export-quality slider.

Offer useful aspect ratios

imageEditorAspectRatioOptions() is the current method name. The older imageEditorAspectRatios() method is an alias. An explicitly enabled rectangular editor also offers Free cropping; a list of suggested ratios is not a server-side dimension rule. Use the field’s image validation rules when the saved image must meet exact requirements.

Open cropping when a selected image has the wrong ratio

imageCropAspectRatio() sets the target used by automatic image preparation. automaticallyOpenImageEditorForAspectRatio() opens guided cropping when the selected image does not match that ratio. Keep server-side file type, byte and dimension rules appropriate to your application; browser editing is not a substitute for validation.

Configure crop geometry

Modes 1, 2 and 3 are supported. Target resize dimensions or imageCropAspectRatio() can determine the initial viewport ahead of the explicit viewport methods.

Circular images and inline avatars

For the full editor with a circular crop and a transparent PNG result:
The avatar layout also has its own inline photo adjustment flow. That inline flow and the full Crop/Adjust editor are different interfaces. To offer selectable characters and optional cropping of a gallery choice, configure the avatar gallery:

Resize the image sent for upload

Automatic resize modes are cover, contain and force. Use both target dimensions for an explicit rectangular target; force can change proportions. imageResizeUpscale(false) prevents automatic resize preparation from enlarging smaller sources. Applied editor output uses configured target dimensions when present. Browser editing and resize settings alter the file supplied to the upload. Named server conversions create separate derivatives after storage. Use server conversions when you need to keep the uploaded image and produce thumbnails or delivery sizes from it.

Create thumbnails from the edited result

The saved replacement becomes the source for its new conversions. Queued conversion work needs a running worker. While a conversion is pending, the original is the preview fallback. See background processing for queue configuration and status updates.

Use Spatie Media Library

Your model must implement Media Library’s integration and define the photos collection and thumb conversion. Define queued conversions on the model with Spatie’s conversion API. Do not add the disk uploader’s imageConversions() as a second conversion engine. Applying an edit updates the form’s draft association; normal form saving persists the replacement through the Spatie adapter.

Bound image memory and output size

The editor checks decoded source and output pixel counts. Its effective pixel limits also account for the configured working-memory allowance, so increasing a pixel count alone does not guarantee admission. File size limits and final server validation still apply. A small compressed file can decode to a large image; configure both byte and pixel budgets.

SVG and output formats

SVG editing rasterizes the image; the resulting upload is PNG, not an editable SVG document. Enable the confirmation when people need a warning before this change:
Use editableSvgs(false) to forbid SVG editing. The inherited default permits SVG editing without a confirmation; confirmSvgEditing() makes the format change explicit. The editor is a static-image workflow and does not preserve animation when exporting a crop of an animated image. For ordinary static images, browser canvas encoding determines the available output formats; circular crops and edited SVGs use PNG.

Private disks and existing images

Stored image access is resolved through the field’s disk or Spatie adapter when editing is opened. Configure valid temporary URLs and CORS for your storage so the browser can fetch the original. A thumbnail resolver changes only presentation; it does not replace the editor’s original-image source. Existing images must belong to the field and be authorized for access. Editor labels come from the package language files, including the file_upload.editor keys. Publish/override translations using Configuration. For translated alt text, titles and captions, configure the separate file information editor; these are editorial metadata, rather than pixel adjustments.

Optional AI editing

To edit images using a configured AI model, add the separate AI image editor. It supports model-specific references and output settings, temporary comparisons and explicit replacement through the upload field.
Last modified on November 29, 2026