home / skills / benchflow-ai / skillsbench / image_editing

This skill helps you automate image editing tasks such as resize, blur, crop, and format conversion using command-line ImageMagick tools.

npx playbooks add skill benchflow-ai/skillsbench --skill image_editing

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
4.2 KB
---
name: image_editing
description: Comprehensive command-line tools for modifying and manipulating images, such as resize, blur, crop, flip, and many more.
license: Proprietary. LICENSE.txt has complete terms
---

# Command-line Tools: Convert

## Overview

This guide covers essential image processing operations using ImageMagick, a collection of command-line tools that can be applied to modify and manipulate images. With this toolkit, you can edit images in batch on Linux command-line.


## Image Operations

Use the `convert` command to resize an image, blur, crop, despeckle, dither, draw on, flip, join, re-sample, and much more.

Example Usage
We list a few examples of the command here to illustrate its usefulness and ease of use. To get started, let's reduce the size of our rose:

```
convert -resize 50% rose.jpg
```
You can resize all your JPEG images in a folder to a maximum dimension of 256x256 with this command:

```
convert -resize 256x256 *.jpg
```

Finally, we convert all our PNG images in a folder to the JPEG format:

```
convert -format jpg *.png
```

Here image files 1.png, 2.png, etc., are left untouched and files 1.jpg, 2.jpg, etc., are created. They are copies of their respective PNG images except are stored in the JPEG image format.

Useful image operations and their corresponding command:

`-auto-orient`
Adjusts an image so that its orientation is suitable for viewing (i.e. top-left orientation). This operator reads and resets the EXIF image profile setting 'Orientation' and then performs the appropriate 90 degree rotation on the image to orient the image, for correct viewing.


`-background <color>`
Set the background color. The color is specified using the format described under the -fill option. The default background color (if none is specified or found in the image) is white.


`-blend <geometry>`
Blend an image into another by the given absolute value or percent. Blend will average the images together ('plus') according to the percentages given and each pixels transparency. If only a single percentage value is given it sets the weight of the composite or 'source' image, while the background image is weighted by the exact opposite amount. That is a -blend 30% merges 30% of the 'source' image with 70% of the 'destination' image. Thus it is equivalent to -blend 30x70%.


`-blue-shift <factor>`
Simulate a scene at nighttime in the moonlight. Start with a factor of 1.5


`-blur radius`
`-blur radius{xsigma}`
Reduce image noise and reduce detail levels. Convolve the image with a Gaussian or normal distribution using the given Sigma value. The formula is:
$$
G(u, v) = \frac{1}{2\pi\sigma^2}e^{-(u^2+v^2)/(2\sigma^2)}
$$
The sigma value is the important argument, and determines the actual amount of blurring that will take place.


`-bordercolor color`
Set the border color. The color is specified using the format described under the -fill option. The default border color is #DFDFDF, this shade of gray.

`-border <value%>`
Surround the image with a border of color. value % of width is added to left/right and value % of height is added to top/bottom

`-brightness-contrast brightness`
`-brightness-contrast brightness{xcontrast}{%}`
Adjust the brightness and/or contrast of the image. Brightness and Contrast values apply changes to the input image. They are not absolute settings. A brightness or contrast value of zero means no change. The range of values is -100 to +100 on each. Positive values increase the brightness or contrast and negative values decrease the brightness or contrast. To control only contrast, set the `brightness=0`. To control only brightness, set `contrast=0` or just leave it off. You may also use `-channel` to control which channels to apply the brightness and/or contrast change. The default is to apply the same transformation to all channels.

`-channel type`
Specify those image color channels to which subsequent operators are limited. Choose from: Red, Green, Blue, Alpha, Gray, Cyan, Magenta, Yellow, Black, Opacity, Index, RGB, RGBA, CMYK, or CMYKA.

`-contrast`
Enhance or reduce the image contrast.

`-colorspace value`
Set the image colorspace.


## Dependencies

Required dependencies (install if not available):

- convert: Run `sudo apt install imagemagick` to install. After that, you can use `convert` command.

Overview

This skill provides a comprehensive set of command-line ImageMagick operations for modifying and manipulating images (resize, blur, crop, flip, convert formats, and more). It is designed for batch and scripted workflows on Linux, enabling fast, repeatable edits without a GUI. The toolkit is lightweight and depends only on the ImageMagick convert utility.

How this skill works

The skill exposes common convert options to perform pixel-level transformations: resizing, blurring, cropping, borders, colorspace changes, brightness/contrast, channel operations, and format conversion. It operates on single files or globs for batch processing and reads EXIF orientation to auto-orient images when requested. Commands compose sequential operators, so you build complex edits by chaining options in a single convert invocation.

When to use it

  • Batch-resize or format-convert large numbers of images from the command line
  • Quickly preprocess images for web or ML (resize, colorspace, max-dimension constraints)
  • Automate image cleanup tasks (despeckle, auto-orient, border trimming)
  • Apply consistent visual adjustments across an image set (brightness/contrast, blur, color shifts)
  • Embed simple overlays, blends, or channel-specific edits in scripted pipelines

Best practices

  • Test commands on a sample image before running on full folders to avoid destructive changes
  • Use glob patterns (e.g., *.png) to operate in batch and output to a separate folder to preserve originals
  • Prefer explicit dimensions (256x256) or percent values for predictable resizing behavior
  • Chain related operations in one convert call to avoid repeated re-encoding and quality loss
  • Specify -quality or output format flags when converting between lossy formats to control file size and fidelity

Example use cases

  • Resize all JPEGs to a maximum of 256x256: convert -resize 256x256 *.jpg
  • Convert PNGs to JPEGs in bulk: convert -format jpg *.png (creates .jpg copies)
  • Auto-orient photos using EXIF then resize: convert -auto-orient -resize 50% input.jpg output.jpg
  • Reduce noise and detail with Gaussian blur: convert -blur 0x2 input.jpg output.jpg
  • Add a colored border (5% of dimensions): convert -bordercolor "#000000" -border 5% input.jpg output.jpg

FAQ

What dependency is required to use this skill?

Install ImageMagick so the convert command is available (e.g., sudo apt install imagemagick).

Will convert overwrite my originals?

By default convert writes to the output filename you provide. Use separate output names or a different folder to preserve originals; test on samples first.