If you find this useful,
Blog
Back to Blog

OpenClaw PNG Tools: Complete Guide to Image Processing with AI Agents

· by Trellis

Process PNG images with your OpenClaw agent: compression, resizing, background removal, format conversion, and generation. Complete skill comparison.

PNG files are everywhere in modern workflows. Screenshots, logos, web graphics, design mockups — the list goes on. If you’re running an OpenClaw agent, you can process all of them through conversation instead of opening Photoshop or hunting for command-line flags.

This guide covers every PNG operation your agent can handle, which skills to install for each task, and how to set them up.


Why Process PNGs with OpenClaw?

Most image editing requires switching tools. Compress a PNG, open TinyPNG. Remove a background, open Remove.bg. Convert formats, remember the ImageMagick syntax. Batch process 50 files, write a script.

OpenClaw turns all of that into plain language:

“Compress these PNGs to under 500KB each.”

“Remove the background from this logo.”

“Convert all these files to WebP.”

Your agent handles the technical details. You describe what you want.


What You Can Do with PNG Files

OpenClaw skills cover five main PNG operations:

  1. Compression and optimization — Reduce file size without visible quality loss
  2. Resizing and cropping — Change dimensions, aspect ratios, or extract regions
  3. Background removal — Isolate subjects on transparent backgrounds
  4. Format conversion — Convert PNG to/from JPG, WebP, AVIF, SVG
  5. Generation — Create new PNG images from text descriptions

Each operation needs a different skill. Some skills handle multiple operations. The sections below break down which skill to use for each task.


PNG Compression and Optimization

Compressing PNGs cuts file sizes for faster page loads, smaller exports, and reduced storage costs. The challenge is doing it without destroying image quality.

sharp-images

The Sharp library wrapped in a skill. Handles PNG compression, resizing, format conversion, and color space adjustments. This is the default choice for most PNG work.

What it does well:

  • Lossless PNG compression (reduce file size without quality loss)
  • Lossy compression with quality control (when you need smaller files and can accept minor quality trade-offs)
  • Metadata stripping (removes EXIF data for privacy or smaller files)
  • Progressive encoding for web delivery

Install it:

clawhub install sharp-images

Example commands:

“Compress this PNG to under 200KB.”

“Optimize all PNGs in this folder for web.”

“Strip metadata from these screenshots.”

Sharp is fast, reliable, and doesn’t need an external API. If you only install one PNG skill, make it this one.

imagemagick-tools

ImageMagick through your agent. Does everything Sharp does, plus advanced operations like layer compositing, distortions, and effects.

The trade-off: ImageMagick has more features but a steeper learning curve. If Sharp handles your use case, stick with Sharp. If you need something ImageMagick-specific (like morphology operations or complex compositing), install this.

Install it:

clawhub install imagemagick-tools

Example commands:

“Use ImageMagick to batch compress these PNGs with maximum quality.”

“Apply a gaussian blur to this PNG.”

ImageMagick needs to be installed on your system first. Check with convert --version in your terminal.

cloudinary

Cloudinary’s image transformation API. Handles compression, resizing, format conversion, and delivery optimization — all through their CDN.

Where Cloudinary stands out: you get image delivery optimization on top of processing. Upload a PNG, get back a URL with automatic format selection (WebP for Chrome, AVIF for supported browsers, PNG as fallback). Good for web projects where you need both processing and hosting.

The downside: requires a Cloudinary account and uploads your images to their service. Not ideal if you want to keep files local.

Needs: Cloudinary API key

Install it:

clawhub install cloudinary

Example commands:

“Upload this PNG to Cloudinary and compress it.”

“Get a Cloudinary URL for this image, optimized for web delivery.”


Resizing and Cropping PNGs

Resizing for different screen sizes, social media dimensions, or thumbnail generation.

Sharp handles resizing with multiple algorithms (nearest neighbor, bicubic, lanczos). You can resize by width, height, or percentage. It maintains aspect ratios by default or crops to exact dimensions if needed.

Example commands:

“Resize this PNG to 1200px wide, keep aspect ratio.”

“Create a 400x400 thumbnail from this image, crop to fit.”

“Scale these PNGs to 50% of their original size.”

imagemagick-tools

ImageMagick offers more control over resizing filters and edge handling. Use it when you need specific resampling algorithms or when working with images that have unusual color spaces.

Example commands:

“Use ImageMagick to resize this PNG with Lanczos filtering.”

“Crop a 1920x1080 region from the center of this image.”


Background Removal

Remove backgrounds to create transparent PNGs for logos, product photos, or design assets.

sharp-images (Basic removal)

Sharp can do basic background removal through chroma keying (removing a specific color) or alpha channel manipulation. This works if you have a solid-color background or existing transparency.

It won’t handle complex backgrounds with multiple colors or gradients. For that, you need an AI-powered tool.

Example command:

“Remove white background from this PNG using Sharp.”

AI Background Removal: fal-ai

For complex backgrounds, you need an AI model that can detect subjects and remove everything else. The fal.ai skill includes background removal models.

Needs: fal.ai API key

Install it:

clawhub install fal-ai

Example commands:

“Remove the background from this product photo.”

“Isolate the subject in this image and make the background transparent.”

Fal.ai’s background removal works on complex images — people in front of detailed scenes, products with shadows, overlapping objects. It produces clean transparency masks.

cloudinary (AI-powered)

Cloudinary also offers AI background removal through their API. Similar quality to fal.ai, but integrated with Cloudinary’s hosting and transformation pipeline.

Example command:

“Upload this to Cloudinary and remove the background.”


Format Conversion

Convert PNGs to other formats or convert other formats to PNG.

Sharp converts between PNG, JPG, WebP, AVIF, TIFF, and raw formats. Fast, local processing. No API needed.

Common conversions:

  • PNG to WebP (better compression for web, but not universally supported)
  • PNG to JPG (smaller files when transparency isn’t needed)
  • JPG to PNG (when you need lossless or transparency)
  • PNG to AVIF (best compression, growing browser support)

Example commands:

“Convert this PNG to WebP.”

“Turn all these JPGs into PNGs.”

“Convert this PNG to AVIF with quality 80.”

imagemagick-tools

ImageMagick supports more formats than Sharp (including obscure ones like PCX, XPM, or DDS). If Sharp doesn’t support your format, ImageMagick probably does.

Example command:

“Use ImageMagick to convert this BMP to PNG.”


PNG Generation from Text

Create new PNG images from text descriptions using AI image generation models.

fal-ai (Best for variety)

Access to FLUX, Stable Diffusion, and other image generation models. One skill, multiple backends. Results come back as PNG files by default.

Needs: fal.ai API key

Install it:

clawhub install fal-ai

Example commands:

“Generate a PNG of a mountain landscape at sunset.”

“Create a transparent PNG logo with a blue geometric design.”

“Generate a 1024x1024 PNG product mockup of a coffee mug.”

pollinations

Similar to fal.ai but with some free-tier generation. Good for experimenting before committing to an API subscription.

Install it:

clawhub install pollinations

Example command:

“Use Pollinations to generate a PNG illustration of a forest.”

runware

Another image generation API with FLUX and Stable Diffusion access. Similar to fal.ai in features, different pricing model.

Needs: Runware API key

Install it:

clawhub install runware

Example command:

“Generate a PNG with Runware using the FLUX model.”


Batch Processing PNGs

Processing multiple files at once — compressing 50 screenshots, resizing 100 product photos, or converting a folder of images.

All the skills above support batch operations. The syntax is conversational:

“Compress all PNGs in this folder.”

“Resize every image in /path/to/images/ to 800px wide.”

“Convert all JPGs in this directory to PNG.”

Your agent iterates through files and applies the operation to each one. Progress updates appear as it works.

Tips for Batch Processing

  1. Be specific about the directory. “All PNGs in ~/Downloads/screenshots” is clearer than “all the screenshots.”

  2. Set clear parameters. “Compress to under 500KB each” is better than “compress them.”

  3. Test on one file first. Run the operation on a single file to verify settings before processing a large batch.


Which Skill to Install First?

If you only install one PNG skill, install sharp-images. It covers 80% of use cases: compression, resizing, format conversion, and basic editing. It’s fast, works offline, and doesn’t need an API key.

clawhub install sharp-images

If you need background removal or image generation, add fal-ai:

clawhub install fal-ai

If you’re working on web projects and want image hosting plus processing, add cloudinary:

clawhub install cloudinary

If you need ImageMagick-specific features (advanced compositing, distortions, obscure formats), add imagemagick-tools:

clawhub install imagemagick-tools

Skill Comparison Table

TaskBest SkillAlternativeNeeds API Key?
Compressionsharp-imagescloudinaryNo (Sharp) / Yes (Cloudinary)
Resizingsharp-imagesimagemagick-toolsNo
Format conversionsharp-imagesimagemagick-toolsNo
Simple background removalsharp-imagesN/ANo
AI background removalfal-aicloudinaryYes
Image generationfal-aipollinations, runwareYes (fal.ai, runware) / Partial (pollinations)
Batch processingsharp-imagesimagemagick-toolsNo
Advanced editingimagemagick-toolssharp-imagesNo
Web deliverycloudinaryN/AYes

Setup and Configuration

Install OpenClaw

If you haven’t set up OpenClaw yet, start with the Getting Started guide. Installation takes five minutes:

curl -fsSL https://install.openclaw.dev | bash

Configure your Claude API key:

openclaw config set api-key YOUR_API_KEY_HERE

Connect a messaging channel (Telegram, WhatsApp, Discord, or Terminal):

openclaw channel add telegram

Start your agent:

openclaw start

Install PNG Skills

Install sharp-images (no API key needed):

clawhub install sharp-images

Install fal-ai for generation and AI background removal:

clawhub install fal-ai

Set your fal.ai API key (get one at fal.ai):

export FAL_KEY=your_api_key_here

Verify the skills loaded:

openclaw skills list

You should see sharp-images and fal-ai in the output.

Test Your Setup

Send your agent a test command:

“Compress this PNG to 500KB” (attach a PNG file)

If it works, you’re ready to process images through conversation.


Real-World Use Cases

Web Developer: Optimize Assets for Production

You export design assets from Figma. They’re uncompressed PNGs, each 3-5MB. You need them under 500KB for fast page loads.

Before: Open each file in an image editor, export with compression settings, check file size, repeat.

With OpenClaw:

“Compress all PNGs in ~/Downloads/assets/ to under 500KB and convert to WebP.”

Your agent processes all files, outputs WebP versions optimized for web delivery.

Content Creator: Remove Backgrounds from Product Photos

You shoot product photos with a white background. You need transparent PNGs for your website.

Before: Upload each photo to Remove.bg, download the result, rename files.

With OpenClaw:

“Remove backgrounds from all images in ~/Photos/products/ and save as transparent PNGs.”

Your agent handles background removal using AI models and saves the results locally.

Developer: Generate Placeholder Images

You’re building a prototype. You need placeholder images for UI mockups.

Before: Search stock photo sites, download images, resize to fit, add to project.

With OpenClaw:

“Generate a 1200x800 PNG of a modern office workspace.”

“Create a transparent PNG icon of a checkmark.”

Your agent generates images and saves them to your project directory.

Designer: Batch Resize for Social Media

You have 50 images that need to be resized for Instagram (1080x1080) and Twitter (1200x675).

Before: Open Photoshop, create actions, run batch process, export.

With OpenClaw:

“Resize all images in ~/Desktop/social/ to 1080x1080 and save to ~/Desktop/social/instagram/”

“Resize the same images to 1200x675 and save to ~/Desktop/social/twitter/”

Your agent processes both batches in parallel.


Advanced PNG Operations

Compositing and Layering

Combine multiple PNG images into one (overlays, watermarks, borders).

Use imagemagick-tools:

“Composite logo.png on top of photo.png in the bottom right corner.”

“Add a watermark to all images in this folder.”

Color Space Conversion

Convert between RGB, CMYK, grayscale, or other color spaces.

Use sharp-images or imagemagick-tools:

“Convert this PNG to grayscale.”

“Change the color space to CMYK for print.”

Alpha Channel Manipulation

Adjust transparency, create transparency masks, or combine alpha channels.

Use sharp-images:

“Set opacity to 50% for this PNG.”

“Extract the alpha channel as a separate image.”

Metadata Management

Strip or preserve EXIF data, color profiles, or embedded metadata.

Use sharp-images:

“Remove all metadata from these PNGs.”

“Preserve color profile when compressing this image.”


Performance and Costs

Local Processing (Sharp, ImageMagick)

  • Speed: Fast. Sharp processes most images in under 1 second. ImageMagick is slightly slower but still sub-second for typical operations.
  • Cost: Free. No API costs. Only uses Claude API tokens for the conversation (a few cents per request).
  • Privacy: Your images never leave your machine.

API-Based Processing (fal.ai, Cloudinary, Pollinations)

  • Speed: Depends on API latency and image size. Typically 2-10 seconds per image.
  • Cost: Varies by service. Fal.ai charges per generation (~$0.01-0.10 per image). Cloudinary has monthly storage and transformation quotas.
  • Privacy: Images are uploaded to third-party servers. Check each service’s privacy policy.

For most PNG work, local processing (Sharp) is faster and cheaper. Use API-based tools only when you need AI features (generation, complex background removal) or cloud delivery (Cloudinary).


Troubleshooting

”Skill not found”

Make sure you installed the skill:

clawhub install sharp-images

Verify it loaded:

openclaw skills list

If it’s not listed, restart your agent:

openclaw restart

“API key required”

Some skills need API keys. Check the skill’s documentation for required environment variables:

  • fal-ai needs FAL_KEY
  • Cloudinary needs CLOUDINARY_CLOUD_NAME, CLOUDINARY_API_KEY, CLOUDINARY_API_SECRET
  • Runware needs RUNWARE_API_KEY

Set them in your environment:

export FAL_KEY=your_key_here

Then restart your agent.

”ImageMagick not found”

The imagemagick-tools skill requires ImageMagick to be installed on your system. Install it:

macOS:

brew install imagemagick

Linux (Ubuntu/Debian):

sudo apt install imagemagick

Linux (Fedora):

sudo dnf install imagemagick

Verify the installation:

convert --version

“Failed to process image”

Check the error message. Common causes:

  • Corrupted input file (try opening it in another app to verify)
  • Unsupported format (PNG should work with all tools, but check for unusual color spaces or metadata)
  • Insufficient disk space (large images need temporary storage during processing)
  • API rate limits (if using fal.ai or Cloudinary)

Try the operation with a different skill or a simpler test image to isolate the problem.


Beyond PNGs: Other Image Formats

The skills in this guide work with more than just PNGs. Sharp and ImageMagick support:

  • JPG/JPEG — Lossy compression for photos
  • WebP — Modern format with better compression than PNG/JPG
  • AVIF — Next-gen format with the best compression (but limited browser support)
  • TIFF — Lossless format for print and archival
  • GIF — Animated images (Sharp can read, ImageMagick can create)
  • SVG — Vector graphics (ImageMagick can rasterize to PNG)
  • BMP, ICO, and dozens of others — ImageMagick supports 200+ formats

The same commands work across formats:

“Compress this JPG to 300KB.”

“Convert this WebP to PNG.”

“Resize this TIFF to 2048px wide.”


Security Considerations

Processing images with an AI agent means files pass through your agent’s context. Two security notes:

  1. Local processing is safer. Sharp and ImageMagick process files on your machine. Your images never leave your system. API-based skills upload files to third-party servers.

  2. Metadata can leak information. EXIF data in images can contain GPS coordinates, camera models, timestamps, and software names. If privacy matters, strip metadata before sharing:

    “Remove all metadata from this PNG.”

For more on securing your OpenClaw setup, see the security articles on Claw Directory.


What’s Next?

You now know how to process PNG images with your OpenClaw agent: compression, resizing, background removal, format conversion, and generation.

Explore More Skills

Build Your Own Image Skill

If none of the existing skills do exactly what you need, creating a custom skill is straightforward. Skills are just Markdown files that tell your agent what to do. The SKILL.md format takes about an hour to learn.

Connect More Channels

Send images to your agent from any platform you already use:

  • Telegram (easiest setup)
  • WhatsApp
  • Discord
  • Signal

See the Getting Started guide for channel configuration.


Summary

OperationRecommended SkillInstall Command
Compressionsharp-imagesclawhub install sharp-images
Resizingsharp-imagesclawhub install sharp-images
Format conversionsharp-imagesclawhub install sharp-images
Background removal (AI)fal-aiclawhub install fal-ai
Image generationfal-aiclawhub install fal-ai
Batch processingsharp-imagesclawhub install sharp-images
Advanced editingimagemagick-toolsclawhub install imagemagick-tools
Web deliverycloudinaryclawhub install cloudinary

OpenClaw makes PNG processing conversational. Install sharp-images, describe what you want, and let your agent handle the technical details.

No more hunting for ImageMagick flags, remembering compression ratios, or switching between five different tools. Just tell your agent what you need done.