vue-advanced-cropper vs vue-cropper vs vue-cropperjs
Image Cropping Solutions for Vue.js Applications
vue-advanced-croppervue-croppervue-cropperjsSimilar Packages:

Image Cropping Solutions for Vue.js Applications

vue-advanced-cropper, vue-cropper, and vue-cropperjs are Vue.js wrapper libraries that provide image cropping functionality in web applications. All three enable users to select, resize, and extract a portion of an image, but they differ significantly in architecture, feature depth, and integration approach. vue-advanced-cropper offers a highly customizable, component-based API built from the ground up for Vue. vue-cropper is a Vue wrapper around the native HTML5 canvas-based cropper logic. vue-cropperjs wraps the popular Cropper.js library, exposing its imperative API through a Vue component.

Npm Package Weekly Downloads Trend

3 Years

Github Stars Ranking

Stat Detail

Package
Downloads
Stars
Size
Issues
Publish
License
vue-advanced-cropper01,185380 kB402 years agoMIT
vue-cropper04,559457 kB1892 years agoISC
vue-cropperjs0974-376 years agoMIT

Image Cropping in Vue: vue-advanced-cropper vs vue-cropper vs vue-cropperjs

When building Vue applications that require image editing—like profile picture uploads, content management tools, or design apps—you’ll likely need a cropping solution. The three main Vue-focused options are vue-advanced-cropper, vue-cropper, and vue-cropperjs. While they all let users select a region of an image, their internal designs, APIs, and trade-offs vary widely. Let’s break them down.

🧱 Core Architecture: Native Vue vs Canvas vs Wrapper

vue-advanced-cropper is built entirely as a Vue component with no external dependencies. It uses SVG overlays and reactive props to manage the crop area, making it feel like a natural part of the Vue ecosystem.

<!-- vue-advanced-cropper: Declarative and reactive -->
<template>
  <AdvancedCropper 
    :src="imageSrc" 
    :stencil-props="{ aspectRatio: 1 }"
    @change="handleCropChange" 
  />
</template>

<script setup>
import { AdvancedCropper } from 'vue-advanced-cropper';

function handleCropChange({ coordinates }) {
  console.log('Crop area:', coordinates);
}
</script>

vue-cropper implements cropping logic directly using the HTML5 <canvas> element. It draws both the original image and the selection mask onto a single canvas, which gives you pixel-level control but limits flexibility for UI customization.

<!-- vue-cropper: Canvas-based -->
<template>
  <vue-cropper
    ref="cropperRef"
    :img="imageSrc"
    :auto-crop="true"
    @real-time="handleRealTime"
  />
</template>

<script setup>
import { VueCropper } from 'vue-cropper';

const cropperRef = ref(null);

function handleRealTime(data) {
  // data contains current crop box info
}

// To get the cropped image:
// cropperRef.value.getCropData()
</script>

vue-cropperjs is a thin Vue wrapper around the standalone Cropper.js library. It renders an <img> tag and lets Cropper.js manipulate it via JavaScript, meaning much of the logic lives outside Vue’s reactivity system.

<!-- vue-cropperjs: Imperative wrapper -->
<template>
  <vue-cropper
    ref="cropperRef"
    :src="imageSrc"
    :aspect-ratio="1"
    @ready="onReady"
  />
</template>

<script setup>
import VueCropper from 'vue-cropperjs';

const cropperRef = ref(null);

function onReady() {
  // Access Cropper.js instance directly
  const canvas = cropperRef.value.getCroppedCanvas();
}
</script>

⚙️ Feature Depth and Customization

Aspect Ratio & Stencils

  • vue-advanced-cropper supports dynamic stencils (crop area shapes) including rectangles, circles, and custom components. You can switch aspect ratios at runtime by updating a prop.
// Change aspect ratio reactively
const stencilProps = computed(() => ({
  aspectRatio: props.isSquare ? 1 : 16 / 9
}));
  • vue-cropper allows setting fixed aspect ratios via props like :fixed="true" and :fixed-number="[16, 9]", but changing them after mount requires calling instance methods.

  • vue-cropperjs inherits Cropper.js’s aspectRatio option, which can be updated via cropper.setAspectRatio(1) on the instance — not reactive.

Rotation and Zoom

  • vue-advanced-cropper does not support image rotation or zoom natively. These would need to be implemented separately.

  • vue-cropper includes basic rotation (rotateLeft, rotateRight methods) and zoom via mouse wheel or buttons, but relies on canvas transforms.

  • vue-cropperjs fully supports rotation (rotate(90)), zoom (zoom(0.1)), and scaling via Cropper.js’s mature API.

🔄 Data Flow and Output Handling

vue-advanced-cropper emits a change event with normalized coordinates (x, y, width, height) relative to the original image. You then use these values with a separate canvas utility (like canvas.getContext('2d').drawImage()) to generate the final image.

function handleCropChange({ coordinates }) {
  const { x, y, width, height } = coordinates;
  // Use these to draw on a hidden canvas
}

vue-cropper provides methods like getCropData() and getCropBlob() that return ready-to-use image data, handling the canvas drawing internally.

const cropData = cropperRef.value.getCropData(); // { x, y, w, h }
const blob = await cropperRef.value.getCropBlob(); // Promise<Blob>

vue-cropperjs exposes getCroppedCanvas() from Cropper.js, which returns an actual <canvas> element you can convert to Blob or data URL.

const canvas = cropperRef.value.getCroppedCanvas();
canvas.toBlob(blob => upload(blob));

🛠️ Maintenance and Long-Term Viability

As of the latest package metadata:

  • vue-advanced-cropper is actively maintained with recent releases supporting Vue 3 and TypeScript.
  • vue-cropper shows signs of abandonment: its GitHub repository has unresolved issues, and the last npm publish was years ago. Avoid for new projects.
  • vue-cropperjs is stable but depends on Cropper.js, which is in maintenance mode (no major new features). Still safe for production if you don’t need cutting-edge capabilities.

🆚 Summary: Key Differences

Featurevue-advanced-croppervue-croppervue-cropperjs
Core TechPure Vue + SVGHTML5 CanvasWrapper for Cropper.js
Reactivity✅ Fully reactive props/events❌ Mostly imperative❌ Instance-based
Rotation/Zoom❌ Not supported✅ Basic support✅ Full support
Custom UI✅ Highly customizable❌ Limited (canvas-only)⚠️ Possible via Cropper.js CSS
Maintenance Status✅ Active❌ Likely abandoned⚠️ Stable but legacy-bound
Vue 3 Support✅ Yes❌ Unclear / Unlikely✅ Via community forks

💡 When to Use Which

  • Need a modern, maintainable solution with clean Vue integration? → Go with vue-advanced-cropper. You’ll write less glue code and benefit from Vue’s reactivity.

  • Building a simple uploader and okay with canvas internals? → Only consider vue-cropper if you’ve verified it works with your Vue version — but prefer alternatives due to maintenance risks.

  • Require rotation, zoom, or are migrating from plain Cropper.js?vue-cropperjs gets you there fastest, but expect to manage the cropper instance manually.

In most new Vue 3 projects, vue-advanced-cropper strikes the best balance between capability, maintainability, and developer experience — unless you specifically need Cropper.js’s advanced image manipulation features.

How to Choose: vue-advanced-cropper vs vue-cropper vs vue-cropperjs

  • vue-advanced-cropper:

    Choose vue-advanced-cropper if you need fine-grained control over the cropping UI and behavior using a declarative, Vue-native component model. It’s ideal for complex interfaces requiring custom handles, aspect ratio presets, or dynamic interaction logic without relying on external DOM manipulation. Its event-driven output integrates cleanly with modern Vue composition APIs.

  • vue-cropper:

    Choose vue-cropper if you prefer a lightweight, canvas-based solution that doesn’t depend on third-party libraries like Cropper.js. It works well for basic to intermediate cropping needs where you want direct access to canvas operations and don’t require advanced features like rotation or zoom. However, note that its maintenance status appears inactive, making it risky for long-term projects.

  • vue-cropperjs:

    Choose vue-cropperjs if you’re already familiar with Cropper.js or need battle-tested features like image rotation, zoom, and cross-browser compatibility out of the box. It’s best suited for projects that prioritize rapid implementation of standard cropping workflows over deep Vue integration, since it exposes an imperative API that requires manual instance management.

README for vue-advanced-cropper

Vue Advanced Cropper logo


Downloads Version Version
Documentation / Examples / Sandbox / Sandbox + Composition API


:fire: HEADS UP! You're currently looking at the branch for Vue 3. For the Vue 2, please check out master branch.


Vue Advanced Cropper is the advanced library that allows you to create custom croppers suited for any website design. It means that you can change not only the cropper's appearance but also its behavior.

Features:

  • full mobile/desktop support
  • support all three main types of croppers right out of the box
  • support both canvas and coordinates modes, minimum and maximum aspect ratios, custom size restrictions
  • zoom, rotate, resize image
  • auto-zoom, transitions

The codesandbox for mobile / desktop examples above.

Install

Vue 3.0

npm install --save vue-advanced-cropper@vue-3
yarn add vue-advanced-cropper@next

Vue 2.0

npm install --save vue-advanced-cropper@vue-2
yarn add vue-advanced-cropper@vue-2

If you would like to use a CDN, please read the corresponding documentation section

Usage

import Vue from 'vue'
import { Cropper } from 'vue-advanced-cropper'
import 'vue-advanced-cropper/dist/style.css';

new Vue({
  el: '#app',
  data: {
    img: 'https://images.pexels.com/photos/226746/pexels-photo-226746.jpeg'
  },
  methods: {
    change({coordinates, canvas}) {
      console.log(coordinates, canvas)
    }
  },
  components: {
    Cropper
  }
})
<div id="app">
  <cropper
    class="cropper"
    :src="img"
    :stencil-props="{
      aspectRatio: 10/12
    }"
    @change="change"
  ></cropper>
</div>
/*
  You may need to set the limits for the cropper sizes or container sizes,
  otherwise, a cropping image will try to fill all available space
*/
.cropper {
  height: 600px;
  background: #DDD;
}

Cropper

PropTypeDescriptionDefault
srcStringThe cropping image (link / base64)
stencilComponentString, ObjectThe stencil componentRectangleStencil
stencilPropsObjectThe props for the stencil component{}
classStringThe optional class for the root cropper block
imageClassStringThe optional class for the cropping image
boundariesClassStringThe optional class for the area.
backgroundClassStringThe optional class for the background under the image
autoZoomBooleanEnable / disable transitionsfalse
transitionsBooleanEnable / disable auto zoomtrue
stencilSizeObject The size of the stencil in pixels
debounceString, NumberThe time before the change event will be emitted after changes (ms)500
canvasBooleanThe flag that indicates if canvas should be usedtrue
minWidthString, NumberThe minimum width of the stencil (percents)
minHeightString, NumberThe minimum height of the stencil (percents)
maxWidthString, NumberThe maximum width of the stencil (percents)
maxHeightString, NumberThe maximum height of the stencil (percents)
checkOrientationBooleanCheck if EXIF orientation should be checkedtrue
resizeImageBoolean, ObjectThe options for the image resizing (details)true
moveImageBoolean, ObjectThe options for the image moving (details)true
imageRestrictionStringSet restrictions for image position ('fill-area' 'fit-area', 'stencil', 'none')'fill-area'
defaultSizeObject, FunctionThe function that returns the default size of the stencil or objectcore.defaultSize
defaultPositionObject, FunctionThe function that returns the default position of the stencil or objectcore.defaultPosition
defaultBoundariesString, FunctionThe function that determines the boundaries size or string ('fill', 'fit')'fill'
sizeRestrictionsAlgorithmFunctionThe function that returns the restrictions object
EventDescription
changeInvoked on the changing of a stencil's position/size after mounting the component and on an image change
readyInvoked on the success of an image loading
errorInvoked on an error of an image loading

RectangleStencil

PropTypeDescriptionDefault
aspectRatioNumberThe aspect ratio
minAspectRatioNumberThe minimum aspect ratio
maxAspectRatioNumberThe maximum aspect ratio
classStringThe class for the root block of the stencil component
previewClassStringThe class for the preview component
movingClassStringThe class applied when the user drags the stencil
resizingClassStringThe class applied when the user resizes the stencil
boundingBoxClassStringThe class for the bounding box component
handlerComponentString,ObjectThe handler component
handlersObjectThe object of handlers that should be visible or hidden.
handlersClassesObjectThe object of custom handler classes
handlersWrappersClassesObjectThe object of custom handler wrapper classes
lineComponentString,ObjectThe handler component
linesObjectThe object of the lines that should be visible or hidden.
linesClassesObjectThe object of custom line classes
linesWrappersClassesObjectThe object of custom line wrapper classes

License

The source code of this library is licensed under the MIT license, and the documentation and photos belong to their respective owners.