png-crop

Crop PNG images to the minimal bounding box of non-transparent content using Pillow.

Updated Apr 5, 2026
One-click install
npx skills add https://github.com/backlin/ai-config --skill png-crop
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: png-crop
Source: https://github.com/backlin/ai-config/tree/main/skills/png-crop
Command: npx skills add https://github.com/backlin/ai-config --skill png-crop

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires Pillow, and includes scripts (resource) components.

What problem does it solve?

This Skill automates the cropping of PNG images to their minimal bounding box of non-transparent content, eliminating the need for manual image editing.

Core Features & Use Cases

  • Automatic Crop: Automatically detects and crops PNG images to the bounding box of non-transparent content.
  • In-Place or Output File: Supports cropping directly in place or to a new output file.
  • Use Case: Perfect for preprocessing images where you only need the content with transparency removed.

Quick Start

Crop the PNG image 'input.png' to the minimal bounding box of non-transparent content.

Frequently Asked Questions about png-crop

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automatically crop a PNG image to its non-transparent content?

To automatically crop a PNG image to its non-transparent content, this Skill detects the minimal bounding box of visible pixels and removes the surrounding transparent borders using the Pillow library.

What is the best way to remove transparent borders from a PNG for computer vision preprocessing?

The best way to remove transparent borders from a PNG for computer vision preprocessing is to automatically calculate the minimal bounding box of non-transparent content and crop the image to those exact dimensions.

Can I crop PNG images in place or do I need to specify an output file?

You can crop PNG images either in place, modifying the original file directly, or by saving the cropped result to a new output file, providing flexibility for your image manipulation workflow.

Do I need the Pillow library to automate PNG image cropping?

Yes, you need the Pillow library installed, as the Skill relies on it to manipulate image pixels and metadata to detect the minimal bounding box of non-transparent content.

Does this automatic PNG cropping method support image formats other than PNG?

This automatic cropping method is specifically intended for PNG images, leveraging their alpha transparency channel to detect non-transparent content, rather than processing other image formats.

Why are my cropped PNG images still retaining transparent borders?

If your cropped PNG images retain transparent borders, ensure the automatic cropping tool is correctly identifying the minimal bounding box of non-transparent content rather than using fixed dimension parameters.