preprocess-image

Normalize input images to 896×896 RGB PNGs for local vision models.

7|3|Updated Mar 8, 2026
One-click install
npx skills add https://github.com/BaiGanio/aperio --skill preprocess-image
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: preprocess-image
Source: https://github.com/BaiGanio/aperio/tree/main/skills/preprocess-image
Command: npx skills add https://github.com/BaiGanio/aperio --skill preprocess-image

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires sharp.

What problem does it solve?

Local vision models often require input images in a standard RGB PNG format with fixed dimensions. This skill ensures any input image is converted to a consistent 896×896 RGB PNG, removing alpha channels, converting color spaces as needed, and filling transparent areas with a solid background so the model receives a predictable input.

Core Features & Use Cases

  • Normalize input images to an RGB PNG with a fixed square size (default 896×896), removing alpha channels and converting color spaces as needed.
  • Adjustable background and size: support white or dark backgrounds and sizes of 896, 512, or 1024 pixels for different detail requirements.
  • Accept both file paths and base64 data inputs; returns a base64-encoded PNG plus a confirmation message for downstream agents.
  • Designed for local vision models (e.g., Ollama, LLaVA, Qwen3-VL) to prevent format-related errors during inference.

Quick Start

Call preprocess_image with a local image path (or base64 data) to obtain a normalized 896×896 RGB PNG suitable for local vision models.

Frequently Asked Questions about preprocess-image

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

FAQPage Schema
How do I normalize images for local vision models like LLaVA or Qwen3-VL?

To normalize images for local vision models, convert them to a consistent 896×896 RGB PNG by removing alpha channels, converting color spaces, and applying letterbox resizing to prevent format-related inference errors.

Can I use sharp to convert image color space and remove alpha channels for model ingestion?

Yes, you can use sharp to remove alpha channels and convert color spaces, producing a ready-to-use base64 RGB PNG specifically formatted for local vision model ingestion.

What is the best way to preprocess transparent PNGs with custom backgrounds before inference?

The best way to preprocess transparent PNGs is to fill alpha areas with a solid white or dark background while resizing the image to a fixed square dimension like 896, 512, or 1024 pixels.

Does preprocess-image accept base64 data inputs or only local file paths?

Preprocess-image accepts both local file paths and base64 data inputs, returning a normalized base64-encoded PNG alongside a confirmation message for downstream agents.

Why do local vision models require fixed square dimensions like 896x896 RGB PNGs?

Local vision models require fixed square dimensions like 896x896 RGB PNGs to receive predictable inputs, avoiding processing errors caused by varying channels, formats, or dimensions from web uploads and local files.