You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

cropify

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cropify

Crop and round image corners seamlessly.

Source
npmnpm
Version
1.0.9-beta.0
Version published
Weekly downloads
763
10.9%
Maintainers
1
Weekly downloads
 
Created
Source

Cropify helps to crop and round image corners seamlessly.

GithubSupport

NPM Version NPM Downloads NPM License GitHub Repo stars

Features

  • Crop images with precision using the Canvas API.
  • Optional support for rounding corners with a customizable border radius.
  • Designed for simplicity and performance.
  • Upscale and cover image.

Installation

npm install cropify

Usage

const { cropImage } = require("cropify");
const fs = require("fs")

const imagePath = 'https://th.bing.com/th/id/OIGP.914kwCtAqWQ7Lkx5hT2B?pid=ImgGn';

const cropX = 0;
const cropY = 0;
const cropWidth = 1280;
const cropHeight = 720;
const borderRadius = 80;

cropImage({
    imagePath: imagePath,
    x: cropX,
    y: cropY,
    width: cropWidth,
    height: cropHeight,
    borderRadius: borderRadius,
    cropCenter: true
}).then(x => {
    fs.writeFileSync("cropped-image.png", x);
});

Note: The image used in this example is generated using DALL-E

Output

example

Licence

MIT

Keywords

crop-image

FAQs

Package last updated on 16 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts