How it works
- Pick an image
Upload a local photo or start with the sample.
- Set ratio and round crop
Adjust the selection, output format, and optional width.
- Copy the Angular code
Copy the template and component, then install ngx-image-cropper in your app.
Built for your Angular workflow
Ngx cropper
ngx-image-cropper provides an Angular-native editor with typed inputs and crop events. Import its standalone component into your app.
Cropper component
Connect the file change event to imageChangedEvent. Handle imageCropped to receive a Blob and object URL, or a base64 data URL.
Aspect ratio
Lock a square, portrait, or landscape selection, or resize freely. Round crop changes the selection appearance, not the exported pixels.
Angular Material
Place ImageCropperComponent inside MatDialog and return the confirmed Blob with MatDialogRef.close(). Use MatSnackBar for save confirmation.
Ionic Angular
Pass a local Camera image as a Blob through imageFile. Match the Capacitor Camera plugin version to your Ionic project.
Angular module
Current NgModule apps import ImageCropperComponent too. ImageCropperModule belongs to historical releases before the standalone API.
Angular image cropper FAQ
What is the best image cropper for Angular?
ngx-image-cropper is our default recommendation for a new Angular app. Its standalone component exposes Angular inputs and crop events directly. Check its Angular peer dependencies before installing; version 9.1.7 requires Angular 17.3 or later.
Can I use ngx-image-cropper with standalone components?
Yes. Add ImageCropperComponent to your component imports. The library became standalone in version 8, which removed ImageCropperModule. An NgModule-based app can also import the standalone component into its NgModule imports.
Does roundCropper export a circular PNG?
No. roundCropper shows a round selection, but the exported image remains square. Display it with border-radius: 50% for an avatar. For a PNG with transparent corners, use the free circle tool above or apply a circular Canvas mask yourself.
Should I store the crop as a blob or base64?
Prefer a Blob for file handling and an object URL for a temporary preview. Use output="base64" only if your integration needs a data URL. An object URL is local and temporary, not a permanent URL you can store or share.
Can this cropper work in Ionic Angular or AngularJS?
Ionic Angular can use ImageCropperComponent with a Camera image passed through imageFile or imageURL. Match the Camera plugin to your Capacitor version. AngularJS 1.x is a different framework and is end of life. ui-cropper was a legacy option; migrate to supported Angular rather than adding a new AngularJS dependency.