Skip to content

Image Processing

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

9 modules

ModuleDescription
画像圧縮品質を維持しながら画像を圧縮してファイルサイズを削減
画像変換画像を別の形式(PNG、JPEG、WEBPなど)に変換
画像を切り抜く指定された座標で画像を切り抜く
画像ダウンロードURLから画像をローカルファイルにダウンロード
OCRテキスト抽出OCRを使って画像からテキストを抽出する
QRコード生成テキスト、URL、またはデータからQRコードを生成
画像リサイズ様々なアルゴリズムで画像を指定サイズにリサイズ
画像を回転する指定された角度で画像を回転する
透かしを追加画像にテキストまたは画像の透かしを追加する

Modules

画像圧縮

image.compress

品質を維持しながら画像を圧縮してファイルサイズを削減

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_pathstring圧縮された画像のパス
original_size_bytesnumber圧縮された画像のパス
compressed_size_bytesnumber元のファイルサイズ(バイト)
compression_rationumber圧縮後のファイルサイズ(バイト)

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

画像変換

image.convert

画像を別の形式(PNG、JPEG、WEBPなど)に変換

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
pathstring変換された画像のパス
sizenumber変換された画像のパス
formatstring変換された画像のパス
dimensionsobjectファイルサイズ(バイト)

Example: Convert PNG to JPEG

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

画像を切り抜く

image.crop

指定された座標で画像を切り抜く

Parameters:

NameTypeRequiredDefaultDescription
input_pathstringYes-入力画像のパス
output_pathstringYes-出力画像のパス
leftnumberYes-切り抜き領域の左の座標
topnumberYes-切り抜き領域の上の座標
rightnumberYes-切り抜き領域の右の座標
bottomnumberYes-切り抜き領域の下の座標

Output:

FieldTypeDescription
output_pathstring切り抜かれた画像のパス
widthinteger切り抜かれた画像の幅
heightinteger切り抜かれた画像の高さ
original_widthinteger元の画像の幅
original_heightinteger元の画像の高さ

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

画像ダウンロード

image.download

URLから画像をローカルファイルにダウンロード

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
pathstringダウンロードされた画像のローカルファイルパス
sizenumberダウンロードされた画像のローカルファイルパス
content_typestringダウンロードされた画像のローカルファイルパス
filenamestringファイルサイズ(バイト)

Example: Download image from URL

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

OCRテキスト抽出

image.ocr

OCRを使って画像からテキストを抽出する

Parameters:

NameTypeRequiredDefaultDescription
image_pathstringYes-画像ファイルのパス
languagestringNoengOCRの言語コード(例: eng, chi_sim)
psmnumberNo3Tesseractのページ分割モード
output_typeselect (text, data, boxes)NotextOCR出力のタイプ(テキストまたはデータ)

Output:

FieldTypeDescription
textstring画像から抽出されたテキスト
confidencenumberOCRの信頼度スコア
languagestringOCRで使用する言語

Example: Extract text from image

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

QRコード生成

image.qrcode_generate

テキスト、URL、またはデータからQRコードを生成

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_pathstring生成されたQRコード画像のパス
file_sizenumber生成されたQRコード画像のパス
dimensionsobject出力ファイルのサイズ(バイト)

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

画像リサイズ

image.resize

様々なアルゴリズムで画像を指定サイズにリサイズ

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_pathstringリサイズされた画像のパス
original_sizeobjectリサイズされた画像のパス
new_sizeobjectリサイズされた画像のパス

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

画像を回転する

image.rotate

指定された角度で画像を回転する

Parameters:

NameTypeRequiredDefaultDescription
input_pathstringYes-入力画像のパス
output_pathstringYes-出力画像のパス
anglenumberYes-回転角度(度)
expandbooleanNoTrue回転された画像全体を保持するために出力を拡張する
fill_colorstringNo#000000回転後の空白部分を埋める色

Output:

FieldTypeDescription
output_pathstring回転された画像のパス
widthinteger回転された画像の幅
heightinteger回転された画像の高さ
anglenumber画像が回転された角度

Example: Rotate 90 degrees

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

透かしを追加

image.watermark

画像にテキストまたは画像の透かしを追加する

Parameters:

NameTypeRequiredDefaultDescription
input_pathstringYes-入力画像のパス
output_pathstringYes-出力画像のパス
textstringNo-透かしとして使用するテキスト
watermark_imagestringNo-透かしとして使用する画像ファイルのパス
positionselect (center, top-left, top-right, bottom-left, bottom-right)Nobottom-right画像上の透かしの位置
opacitynumberNo0.5透かしの不透明度(0.0から1.0)
font_sizenumberNo36テキスト透かしのフォントサイズ

Output:

FieldTypeDescription
output_pathstring透かし入り画像のパス
watermark_typestring適用する透かしの種類(テキストまたは画像)

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.