2.0.6 • Published 6 months ago

crop-background-image v2.0.6

Weekly downloads
-
License
ISC
Repository
github
Last release
6 months ago

Image Cropping Utility with TypeScript

This TypeScript project contains a function that crops the edges of images with transparent backgrounds by detecting the edge colors.

Usage

The project includes a class named CropImageHelper, which contains a function named cropImage that can be used as shown below:

import { CropImageHelper } from "crop-background-image";

async function cropExample() {
  try {
    const imageUrl = "Here comes the image URL.";
    const croppedImage = await new CropImageHelper(imageUrl).cropImage();
    // croppedImage contains the base64 encoded data of the cropped image
    console.log("Cropped Image:", croppedImage);
  } catch (error) {
    console.error("Error:", error);
  }
}

cropExample();
BeforeAfter
Before ImageAfter Image
BeforeAfter
Before ImageAfter Image
2.0.6

6 months ago

2.0.5

6 months ago

2.0.4

6 months ago

2.0.3

6 months ago

2.0.2

6 months ago

2.0.1

6 months ago

2.0.0

6 months ago

1.0.0

6 months ago