npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@adiputera/cli-image-resizer

v1.0.2

Published

CLI Image resizer and converter using sharp and heic-decode for HEIC support

Readme

CLI Image Resizer

A lightweight CLI tool for image resizing and conversion, built with TypeScript, Sharp, and heic-decode.

Features

  • 📸 HEIC/HEIF Support: Convert HEIC/HEIF images to standard formats (PNG, JPEG, WebP, AVIF, GIF)
  • 🖼️ Multiple Formats: Support for WebP, AVIF, PNG, JPEG, GIF
  • 📏 Smart Resizing: Multiple fit strategies (cover, contain, fill, inside, outside)
  • 🎨 Image Effects: Rotation, blur, grayscale, and cropping
  • 🌐 URL Support: Download and process images directly from URLs
  • Fast & Efficient: Powered by Sharp's high-performance image processing

Prerequisites

  • Node.js 18+ or 20+

Installation

Install globally via npm:

npm install -g @adiputera/cli-image-resizer

Alternatively, run it directly without installing using npx:

npx @adiputera/cli-image-resizer -i <input> -o <output> [options]

Local Development Setup

If you want to run or modify the tool locally:

  1. Install dependencies:
npm install
  1. Build the project:
npm run build
  1. (Optional) Link globally to use as image-resizer everywhere:
npm link

Usage

Once installed globally or linked, you can run the tool using the image-resizer command:

image-resizer -i <input> -o <output> [options]

(Note: If you are running this from the local repository setup, simply replace image-resizer with npm run cli -- in the examples below.)

Options

  • -i, --input <path/url> (Required): Input file path or URL to download.
  • -o, --output <path> (Required): Output file path.
  • -w, --width <pixels>: Target width in pixels.
  • -h, --height <pixels>: Target height in pixels.
  • -f, --format <format>: Output format (e.g., webp, jpeg, png, avif, gif).
  • -q, --quality <number>: Output quality (1-100). Default is 80.
  • -a, --action <action>: Action to perform (resize, crop). Default is resize.
  • --fit <strategy>: Fit strategy (cover, contain, fill, inside, outside).
  • --withoutEnlargement: Prevent enlarging the image if it is smaller than the target size.
  • --rotate <degrees/auto>: Degrees to rotate the image, or auto for EXIF orientation.
  • --blur <sigma>: Sigma value for Gaussian blur.
  • --grayscale: Convert the image to grayscale.
  • --help: Show the help message.

Examples

Basic Resize (Local file) Resize an image to 800x600 pixels.

image-resizer -i photo.jpg -o photo-resized.jpg -w 800 -h 600

Convert HEIC to Standard Format Convert HEIC/HEIF images to PNG, JPEG, or WebP.

# Convert HEIC to JPEG
image-resizer -i IMG_1234.HEIC -o output.jpg -f jpg -q 90

# Convert HEIC to WebP with resize
image-resizer -i IMG_1234.HEIC -o output.webp -f webp -w 1920 -q 85

Convert Format & Adjust Quality Convert a PNG to WebP with 90% quality.

image-resizer -i image.png -o image.webp -f webp -q 90

Process an Image from a URL Download and convert an image from the web directly into AVIF format.

image-resizer -i "https://example.com/logo.png" -o logo.avif -f avif

Advanced Transformations (Grayscale, Blur, and Rotate) Rotate by 90 degrees, convert to grayscale, and add a blur effect.

image-resizer -i original.jpg -o modified.jpg --rotate 90 --grayscale --blur 5.5

Use a Specific Fit Strategy Ensure the entire image is visible within a 500x500 box without cropping (contain), preserving aspect ratio.

image-resizer -i photo.jpg -o photo-contained.jpg -w 500 -h 500 --fit contain

Contributing & Bug Reports

Contributions, issues, and feature requests are very welcome!

  • Found a bug? Please feel free to open an issue in the repository with details about what went wrong and, if possible, the image file that caused the problem.
  • Want to contribute? Feel free to fork the repository and submit a Pull Request.

License

This project is licensed under the MIT License.