Lightweight, pure JavaScript image cropping library - No dependencies, easy integration
// Create a cropper instance const cropper = new ImageCropper('#container', { width: 500, height: 500, cropMode: 'free' }); // Load an image await cropper.loadImage('path/to/image.jpg'); // Export the cropped image const base64Data = cropper.export('image/jpeg', 0.9); console.log(base64Data);
<!-- Include library file --> <script src="image-cropper.js"></script> <!-- Create container --> <div id="container"></div>