sail(1)
| SAIL(1) | SAIL command-line utility | SAIL(1) |
NAME
sail - SAIL command-line utility for image conversion
SYNOPSIS
sail [OPTIONS] COMMAND [ARGUMENTS]
DESCRIPTION
SAIL (Simple Abstract Imaging Library) is a cross-platform imaging library that provides a unified API for loading, saving, and manipulating images in various formats.
GLOBAL OPTIONS
- -h, --help
- Display help message and exit.
- -v, --version
- Display version information and exit.
- -l, --log-level LEVEL
- Set log level. Valid levels are:
- silence - No output
- error - Error messages only
- warning - Warnings and errors (default)
- info - Informational messages
- message - All messages
- debug - Debug information
- trace - Detailed trace information
COMMANDS
list
List all supported image codecs with details.
Usage:
- -v
- Verbose output with detailed codec information.
convert
Convert, compose, and extract image files.
Usage:
- -p, --pixel-format FORMAT
- Force specific output pixel format. Common formats include:
- BPP24-RGB - 24-bit RGB
- BPP32-RGBA - 32-bit RGBA
- BPP8-GRAYSCALE - 8-bit grayscale
- BPP8-INDEXED - 8-bit indexed color
- -c, --compression LEVEL
- Set compression quality level (codec-specific). Use -1 for default compression.
- -m, --max-frames COUNT
- Limit number of frames to process. Use 0 to process all frames.
- -n, --frame-number N
- Extract specific frame number N (1-based). This is useful for extracting a single frame from animated images.
- -d, --delay MS
- Set frame delay for animations in milliseconds.
- -e, --extract-frames
- Extract each frame to separate file. Output filename will be in the format BASE-N.EXT where N is the frame number.
- -C, --colors N
- Quantize image to N colors (2-256) using Wu algorithm. This reduces the number of colors in the image for smaller file sizes.
- -D, --dither
- Apply Floyd-Steinberg dithering for better gradients when reducing colors.
- -b, --background COLOR
- Blend alpha channel with background color. Valid colors are:
- white - White background
- black - Black background
- #RRGGBB - Hex color code (e.g., #FF0000 for red)
- -s, --strip
- Remove all metadata from output files.
- -H, --flip-horizontal
- Flip image horizontally (mirror left-right).
- -V, --flip-vertical
- Flip image vertically (mirror top-bottom).
probe
Display detailed information about image file.
Usage:
decode
Decode file and show information for all frames.
Usage:
EXAMPLES
Basic conversion:
# Convert JPEG to PNG:
sail convert input.jpg output.png
# Convert with custom quality:
sail convert input.png output.jpg -c 90 -p BPP24-RGB
Animation handling:
# Convert animation with specified frame delay:
sail convert animation.gif output.webp -d 100
# Convert animation to multi-page document:
sail convert animation.gif output.tiff
# Compose multiple images into single animation:
sail convert frame1.png frame2.png frame3.png animation.gif -d 100
Frame extraction:
# Extract all frames from animation:
sail convert animation.gif frame.jpg -e
# Extract first 5 frames only:
sail convert animation.webp frame.png -e -m 5
# Extract specific frame (e.g., frame 2):
sail convert animation.gif frame2.png -n 2
Color reduction:
# Reduce colors to 16 with dithering:
sail convert photo.jpg output.gif --colors 16 --dither
Alpha channel handling:
# Convert RGBA to RGB with white background:
sail convert transparent.png opaque.jpg --background white
Metadata and transformations:
# Strip metadata for privacy:
sail convert photo.jpg clean.jpg --strip
# Flip image horizontally and vertically:
sail convert photo.jpg flipped.jpg -H -V
Information display:
# Show detailed image information:
sail probe image.png
# Decode and show all frame information:
sail decode animation.gif
# List all supported codecs:
sail list -v
SUPPORTED FORMATS
SAIL supports a wide range of image formats including:
AVIF, BMP, GIF, HEIF, ICO, JPEG, JPEG2000, PNG, TIFF, and other.
Use sail list to see all supported formats and their capabilities.
EXIT STATUS
sail returns 0 on success, or a SAIL error code on failure. Common error codes include:
- 0
- Success
- 3
- SAIL_ERROR_OPEN_FILE - Failed to open file (file not found, permission denied, etc.)
- 9
- SAIL_ERROR_INVALID_ARGUMENT - Invalid command line arguments
- 51
- SAIL_ERROR_INVALID_IMAGE - Invalid or corrupted image file
For a complete list of SAIL error codes, see the SAIL library documentation.
SEE ALSO
For more information about SAIL, visit: https://sail.software
AUTHOR
SAIL was written by Dzmitry Baryshau and contributors.
COPYRIGHT
Copyright (c) 2020-2025 Dzmitry Baryshau. Licensed under the MIT License.
| October 2025 | SAIL 0.9.10 |
