How to reset an image in EJ2 TypeScript Image Editor

4 Sep 20261 minute to read

The reset method reverts the image in the Image Editor to its original state, discarding every edit applied after the image was opened — including annotations, transforms, finetune adjustments, and filters. It takes no arguments and returns void.

Use reset when you want to start over with the unmodified image rather than undoing individual steps one at a time. This differs from undo, which steps back a single action, and from clearImage, which removes the image from the canvas entirely without reloading the original.

Steps to reset an image

  1. Initialize the ImageEditor and open an image.
  2. Apply any edits (annotations, transforms, finetune, filters).
  3. Call imageEditorObj.reset() to discard all edits and restore the original image.

The following example loads an image on creation and resets it when the Reset button is clicked:

// Discards all edits and restores the original image. Returns: void
imageEditorObj.reset();

Note: A reset clears the current edits. Use undo if you only want to revert the most recent action.