Skip to content

Image Processing

Resize, crop, compress, convert, OCR, QR codes, and watermarks.

9 modules

ModuleDescription
Compress ImageCompress images to reduce file size while maintaining quality
Convert ImageConvert image to different format (PNG, JPEG, WEBP, etc.)
Crop ImageCrop an image to specified coordinates
Download ImageDownload image from URL to local file
OCR Extract TextExtract text from images using OCR
Generate QR CodeGenerate QR codes from text, URLs, or data
Resize ImageResize images to specified dimensions with various algorithms
Rotate ImageRotate an image by specified degrees
Add WatermarkAdd text or image watermark to an image

Modules

Compress Image

image.compress

Compress images to reduce file size while maintaining quality

Parameters:

NameTypeRequiredDefaultDescription
input_pathstringYes-Path to the input image file
output_pathstringNo-Path where the processed image will be saved
qualitynumberNo85Quality level (1-100, higher is better)
optimizebooleanNoTrueApply additional optimization
max_size_kbnumberNo-Target maximum file size in KB
formatselect (png, jpeg, webp, gif, bmp, tiff)NopngOutput image format

Output:

FieldTypeDescription
output_pathstringPath to the compressed image
original_size_bytesnumberPath to the compressed image
compressed_size_bytesnumberOriginal file size in bytes
compression_rationumberCompressed file size in bytes

Example: Compress with quality setting

yaml
input_path: /path/to/image.jpg
quality: 75

Example: Compress to target size

yaml
input_path: /path/to/image.png
max_size_kb: 500

Convert Image

image.convert

Convert image to different format (PNG, JPEG, WEBP, etc.)

Parameters:

NameTypeRequiredDefaultDescription
input_pathstringYes-Path to the input image file
output_pathstringNo-Path where the processed image will be saved
formatselect (png, jpeg, webp, gif, bmp, tiff)YespngOutput image format
qualitynumberNo85Quality level (1-100, higher is better)
resizeobjectNo-Resize options:

Output:

FieldTypeDescription
pathstringPath to the converted image
sizenumberPath to the converted image
formatstringPath to the converted image
dimensionsobjectFile size in bytes

Example: Convert PNG to JPEG

yaml
input_path: /tmp/image.png
format: jpeg
quality: 90

Crop Image

image.crop

Crop an image to specified coordinates

Parameters:

NameTypeRequiredDefaultDescription
input_pathstringYes-Path to the input image
output_pathstringYes-Path for the output image
leftnumberYes-Left coordinate of the crop area
topnumberYes-Top coordinate of the crop area
rightnumberYes-Right coordinate of the crop area
bottomnumberYes-Bottom coordinate of the crop area

Output:

FieldTypeDescription
output_pathstringPath to the cropped image
widthintegerWidth of the cropped image
heightintegerHeight of the cropped image
original_widthintegerOriginal image width
original_heightintegerOriginal image height

Example: Crop center region

yaml
input_path: /path/to/image.png
output_path: /path/to/cropped.png
left: 100
top: 100
right: 500
bottom: 400

Download Image

image.download

Download image from URL to local file

Parameters:

NameTypeRequiredDefaultDescription
urlstringYes-URL of the image to download
output_pathstringNo-Path where the processed image will be saved
output_dirstringNo/tmpDirectory where output files will be saved
headersobjectNo{}HTTP request headers as key-value pairs
timeoutnumberNo30Maximum time to wait in seconds

Output:

FieldTypeDescription
pathstringLocal file path of downloaded image
sizenumberLocal file path of downloaded image
content_typestringLocal file path of downloaded image
filenamestringFile size in bytes

Example: Download image from URL

yaml
url: https://example.com/photo.jpg
output_dir: /tmp/images

OCR Extract Text

image.ocr

Extract text from images using OCR

Parameters:

NameTypeRequiredDefaultDescription
image_pathstringYes-Path to the image file
languagestringNoengLanguage code for OCR (e.g. eng, chi_sim)
psmnumberNo3Tesseract page segmentation mode
output_typeselect (text, data, boxes)NotextType of OCR output (text or data)

Output:

FieldTypeDescription
textstringExtracted text from the image
confidencenumberOCR confidence score
languagestringLanguage used for OCR

Example: Extract text from image

yaml
image_path: /path/to/document.png
language: eng

Generate QR Code

image.qrcode_generate

Generate QR codes from text, URLs, or data

Parameters:

NameTypeRequiredDefaultDescription
datastringYes-Text, URL, or data to encode
output_pathstringNo-Path where the processed image will be saved
formatselect (png, svg)NopngOutput image format
sizenumberNo300Size in pixels
colorstringNo#000000Color of the QR code (hex or name)
backgroundstringNo#FFFFFFBackground color (hex or name)
error_correctionselect (L, M, Q, H)NoMError correction level
bordernumberNo4Border width in modules (quiet zone)
versionnumberNo-QR code version 1-40 (leave empty for auto-detect)
logo_pathstringNo-Path to logo image to embed in center

Output:

FieldTypeDescription
output_pathstringPath to the generated QR code image
file_sizenumberPath to the generated QR code image
dimensionsobjectSize of the output file in bytes

Example: Generate URL QR code

yaml
data: https://flyto.dev
output_path: /tmp/flyto_qr.png

Example: Custom styled QR code

yaml
data: Hello World
color: #6366F1
size: 500
error_correction: H

Example: SVG QR code

yaml
data: https://flyto.dev
format: svg
border: 2

Resize Image

image.resize

Resize images to specified dimensions with various algorithms

Parameters:

NameTypeRequiredDefaultDescription
input_pathstringYes-Path to the input image file
output_pathstringNo-Path where the processed image will be saved
widthnumberNo-Target width in pixels
heightnumberNo-Target height in pixels
scalenumberNo-Scale factor (e.g., 0.5 for half, 2.0 for double)
algorithmselect (lanczos, bicubic, bilinear, nearest)NolanczosResampling algorithm for resize
maintain_aspectbooleanNoTrueMaintain original aspect ratio

Output:

FieldTypeDescription
output_pathstringPath to the resized image
original_sizeobjectPath to the resized image
new_sizeobjectPath to the resized image

Example: Resize to specific dimensions

yaml
input_path: /path/to/image.png
width: 800
height: 600

Example: Scale by factor

yaml
input_path: /path/to/image.png
scale: 0.5

Rotate Image

image.rotate

Rotate an image by specified degrees

Parameters:

NameTypeRequiredDefaultDescription
input_pathstringYes-Path to the input image
output_pathstringYes-Path for the output image
anglenumberYes-Rotation angle in degrees
expandbooleanNoTrueExpand output to hold the entire rotated image
fill_colorstringNo#000000Color to fill empty areas after rotation

Output:

FieldTypeDescription
output_pathstringPath to the rotated image
widthintegerWidth of the rotated image
heightintegerHeight of the rotated image
anglenumberAngle the image was rotated

Example: Rotate 90 degrees

yaml
input_path: /path/to/image.png
output_path: /path/to/rotated.png
angle: 90

Add Watermark

image.watermark

Add text or image watermark to an image

Parameters:

NameTypeRequiredDefaultDescription
input_pathstringYes-Path to the input image
output_pathstringYes-Path for the output image
textstringNo-Text to use as watermark
watermark_imagestringNo-Path to image file to use as watermark
positionselect (center, top-left, top-right, bottom-left, bottom-right)Nobottom-rightPosition of the watermark on the image
opacitynumberNo0.5Watermark opacity (0.0 to 1.0)
font_sizenumberNo36Font size for text watermark

Output:

FieldTypeDescription
output_pathstringPath to the watermarked image
watermark_typestringType of watermark applied (text or image)

Example: Add text watermark

yaml
input_path: /path/to/image.png
output_path: /path/to/watermarked.png
text: © 2026 Company
position: bottom-right
opacity: 0.5

Released under the Apache 2.0 License.