Convert Image Processor

Overview

The Convert Image processor (convert_image) loads an input image and re-encodes or saves it in a different format (e.g., PNG → JPEG). This is useful for normalizing output formats across your pipeline or changing the compression/quality settings. Unlike more complex color or filter operations, Convert Image focuses only on format conversion.


Example Usage

- processor:
    processor: "convert_image"
    inputs:
      source: "output/input.png"
    params:
      quality: "85" # (Optional) JPEG compression level
    outputs:
      target: "output/output.jpg"

Explanation:

  1. source: The path to the input image.
  2. quality: If you are saving to a format that supports compression (e.g., JPEG), this sets the compression level.
  3. target: The converted file. The format is inferred from the file extension (e.g., .jpg, .png, etc.).

Inputs

Key Required Description
source Yes A file path referencing the input image to be converted.

(The processor loads from your storage system using this path.)


Params

(Optional parameters for controlling certain format details.)

Key Type Required Default Description
quality int 85 (JPEG/WEBP/etc.) If the target extension is a format that supports compression/quality, sets the compression level (e.g., 0-100).

Outputs

Key Required Description
target The final converted image path (e.g., .jpg, .png). The extension determines the format used by the underlying library.

Workflow

  1. Load the source image from your storage system.
  2. Infer the target format from the file extension (e.g., .jpg, .png).
  3. Apply optional parameters like quality if the chosen format supports it (JPEG, etc.).
  4. Save the image to target in the chosen format.

Use Cases:


Notes