explaingit

aheckmann/gm

6,978JavaScriptAudience · developerComplexity · 2/5Setup · moderate

TLDR

A Node.js library (now officially unmaintained since 2025) that wraps GraphicsMagick and ImageMagick so you can resize, convert, and edit images in JavaScript without writing shell commands by hand.

Mindmap

mindmap
  root((gm))
    What it does
      Image processing in Node.js
      Wraps GraphicsMagick
      Wraps ImageMagick
    Operations
      Resize and crop
      Format conversion
      Text and filters
    Status
      Unmaintained since 2025
      Security risk accumulating
      Migrate to cross-spawn
    Audience
      Node.js developers
      Backend engineers
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Resize and convert uploaded image files in a Node.js web server before saving them to storage

USE CASE 2

Strip EXIF metadata from photos and batch-convert them to a different format in a backend script

USE CASE 3

Rotate images and add text overlays in a Node.js processing pipeline without shelling out manually

Tech stack

JavaScriptNode.jsGraphicsMagickImageMagick

Getting it running

Difficulty · moderate Time to first run · 30min

Requires GraphicsMagick or ImageMagick binaries installed on the host system before the npm package will work.

In plain English

This repository is the source code for a Node.js library called gm, which let developers work with images in JavaScript by calling GraphicsMagick or ImageMagick under the hood. GraphicsMagick and ImageMagick are established command-line programs for processing images: resizing them, converting between formats, adding text, applying filters, and many other operations. The gm library wrapped those programs so that JavaScript developers could trigger the same operations from code without writing shell commands by hand. Using the library, a developer could write a short script to resize a photo, strip its metadata, rotate it, draw shapes on it, or convert it from one format to another. The library supported reading images from files, from incoming network streams, or from raw data buffers, and it could write the output back to files or send it as a stream to another part of the application. As of February 2025, the original author officially marked the project as unmaintained. The README states that no further issues will be addressed, no pull requests will be merged, and no new releases will be published. The author started the project in 2010 as part of a startup, sold the company that same year, and had not used the library in over a decade before sunsetting it. Existing published versions remain available to install via npm, but the README advises moving away from this library because unpatched security vulnerabilities will accumulate over time with no one to fix them. The suggested replacement is to call the GraphicsMagick or ImageMagick binaries directly using a utility like cross-spawn, which is essentially what this library was doing internally.

Copy-paste prompts

Prompt 1
Using the gm Node.js library, write a script that resizes an uploaded image to 800x600, strips its EXIF metadata, and saves it as a JPEG.
Prompt 2
Show me how to use gm to pipe an image from an HTTP request stream, resize it, and stream the output directly to the HTTP response.
Prompt 3
The gm library is now unmaintained. Show me how to replace my existing gm resize and format-convert calls with direct ImageMagick invocations using cross-spawn.
Prompt 4
I need to draw a text watermark on a series of images using gm. Show me the gm API calls for adding text with a specific font size and position.
Open on GitHub → Explain another repo

← aheckmann on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.