Skip to main content
The image utility is a command-line tool for converting between image formats, manipulating images, and extracting metadata. It supports multiple image formats and provides various transformation operations.

Supported formats

Input formats

  • PNG - Portable Network Graphics
  • JPEG - Joint Photographic Experts Group
  • GIF - Graphics Interchange Format
  • BMP - Bitmap Image File
  • WebP - WebP image format
  • ICO - Icon format
  • TIFF - Tagged Image File Format
  • PBM/PGM/PPM - Portable Anymap formats

Output formats

  • PNG - With compression level control
  • JPEG - With quality control
  • BMP - Bitmap output
  • WebP - Lossy and lossless modes

Usage

Common operations

Format conversion

Convert between formats by specifying different input and output extensions:

Image transformations

Cropping

Crop image to specific rectangle:

Strip alpha channel

Remove transparency:

Move alpha to RGB

Convert alpha channel to grayscale RGB:

CMYK operations

For CMYK images (typically from JPEG files):

Quality and compression

JPEG quality

PNG compression

WebP encoding

Frame extraction

Extract specific frame from animated images:

Metadata operations

ICC profile handling

The utility preserves ICC color profiles when converting between formats that support them.

Implementation details

The image utility uses:
  • LibGfx: Core image decoding and encoding
  • ImageDecoder: Format-specific decoders
  • ImageWriter: Format-specific encoders (PNG, JPEG, BMP, WebP)
Source: ~/workspace/source/Utilities/image.cpp
The utility automatically detects the input format based on file content, not extension.
CMYK operations are only available for images with CMYK color space (typically JPEG files).
Some operations like cropping are not yet supported for CMYK bitmaps.