{
  "schemaVersion": "1.0",
  "item": {
    "slug": "libvips-image",
    "name": "Libvips Image",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/h1bomb/libvips-image",
    "canonicalUrl": "https://clawhub.ai/h1bomb/libvips-image",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/libvips-image",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=libvips-image",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "VALIDATION_REPORT.md",
      "pyproject.toml",
      "scripts/install.sh",
      "scripts/run.sh",
      "scripts/test_vips_tool.py"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "slug": "libvips-image",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-02T04:29:18.288Z",
      "expiresAt": "2026-05-09T04:29:18.288Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=libvips-image",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=libvips-image",
        "contentDisposition": "attachment; filename=\"libvips-image-0.1.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "libvips-image"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/libvips-image"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/libvips-image",
    "agentPageUrl": "https://openagent3.xyz/skills/libvips-image/agent",
    "manifestUrl": "https://openagent3.xyz/skills/libvips-image/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/libvips-image/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "libvips Image Processing",
        "body": "Fast, memory-efficient image processing using libvips via pyvips. Supports 300+ operations including resize, crop, rotate, convert, watermark, composite, and more. Ideal for batch processing large images."
      },
      {
        "title": "When to Use",
        "body": "Resize, crop, or thumbnail images efficiently\nConvert between formats (JPEG, PNG, WebP, AVIF, HEIC, TIFF, PDF, SVG)\nAdd watermarks or text overlays\nBatch process multiple images\nHandle large images with low memory usage\nCreate image pipelines for web optimization"
      },
      {
        "title": "Install (One-Click)",
        "body": "# Recommended: Auto-detect OS and install everything\n./scripts/install.sh\n\nThe install script will:\n\nDetect your OS (macOS, Linux, Windows)\nInstall libvips system library\nInstall pyvips via uv (preferred) or pip\nVerify the installation"
      },
      {
        "title": "Manual Install",
        "body": "macOS (Homebrew):\n\nbrew install vips\nuv pip install pyvips  # preferred\n# or: pip install pyvips\n\nUbuntu/Debian:\n\nsudo apt-get install libvips-dev\nuv pip install pyvips  # preferred\n# or: pip install pyvips\n\nFedora/RHEL:\n\nsudo dnf install vips-devel\nuv pip install pyvips\n\nArch Linux:\n\nsudo pacman -S libvips\nuv pip install pyvips\n\nWindows (PowerShell, recommended):\n\n# One-click install (downloads libvips + installs pyvips)\n.\\scripts\\install.ps1\n\nWindows (Manual):\n\n# Option 1: winget (if available)\nwinget install libvips.libvips\n\n# Option 2: scoop\nscoop install libvips\n\n# Option 3: Manual download\n# Download from https://github.com/libvips/libvips/releases\n# Extract to C:\\vips or %LOCALAPPDATA%\\vips\n# Add bin\\ to PATH\n\n# Install pyvips\nuv pip install pyvips\n# or: pip install pyvips\n\nInstall uv (if not installed):\n\n# macOS/Linux\ncurl -LsSf https://astral.sh/uv/install.sh | sh\n\n# Windows (PowerShell)\nirm https://astral.sh/uv/install.ps1 | iex"
      },
      {
        "title": "Basic Usage",
        "body": "macOS/Linux - Using run.sh wrapper (recommended):\n\n./scripts/run.sh vips_tool.py resize input.jpg output.jpg --width 800\n./scripts/run.sh vips_tool.py convert input.jpg output.webp --quality 85\n./scripts/run.sh vips_tool.py thumbnail input.jpg thumb.jpg --size 200\n./scripts/run.sh vips_batch.py resize ./input ./output --width 800\n\nWindows - Using run.bat wrapper (recommended):\n\n.\\scripts\\run.bat vips_tool.py resize input.jpg output.jpg --width 800\n.\\scripts\\run.bat vips_tool.py convert input.jpg output.webp --quality 85\n.\\scripts\\run.bat vips_tool.py thumbnail input.jpg thumb.jpg --size 200\n.\\scripts\\run.bat vips_batch.py resize .\\input .\\output --width 800\n\nCross-platform - Using uv (after uv sync):\n\nuv run python scripts/vips_tool.py resize input.jpg output.jpg --width 800\n\nDirect Python (if library paths are configured):\n\npython scripts/vips_tool.py resize input.jpg output.jpg --width 800\npython scripts/vips_tool.py convert input.jpg output.webp --quality 85\npython scripts/vips_tool.py thumbnail input.jpg thumb.jpg --size 200\npython scripts/vips_tool.py watermark input.jpg output.jpg --text \"Copyright 2024\""
      },
      {
        "title": "Supported Formats",
        "body": "FormatReadWriteNotesJPEGYesYesQuality 1-100PNGYesYesCompression 0-9WebPYesYesLossy/losslessAVIFYesYesModern, high compressionHEICYesYesApple formatTIFFYesYesMulti-page supportGIFYesYesAnimated supportPDFYesYesVia popplerSVGYesNoVia librsvgRAWYesNoVia libraw"
      },
      {
        "title": "1) Resize",
        "body": "Resize images with various fit modes.\n\n# Resize to exact width, maintain aspect ratio\npython scripts/vips_tool.py resize input.jpg output.jpg --width 800\n\n# Resize to exact height\npython scripts/vips_tool.py resize input.jpg output.jpg --height 600\n\n# Resize to fit within bounds\npython scripts/vips_tool.py resize input.jpg output.jpg --width 800 --height 600\n\n# Resize to cover (fill) dimensions\npython scripts/vips_tool.py resize input.jpg output.jpg --width 800 --height 600 --mode cover\n\n# Force exact dimensions (may distort)\npython scripts/vips_tool.py resize input.jpg output.jpg --width 800 --height 600 --mode force\n\nResize modes:\n\nfit (default): Fit within bounds, maintain aspect ratio\ncover: Cover bounds, crop excess\nforce: Force exact dimensions"
      },
      {
        "title": "2) Thumbnail",
        "body": "Create optimized thumbnails with smart cropping.\n\n# Square thumbnail\npython scripts/vips_tool.py thumbnail input.jpg thumb.jpg --size 200\n\n# Attention-based smart crop\npython scripts/vips_tool.py thumbnail input.jpg thumb.jpg --size 200 --crop attention\n\n# Center crop\npython scripts/vips_tool.py thumbnail input.jpg thumb.jpg --size 200 --crop centre\n\nCrop strategies:\n\nnone: No cropping, fit within size\ncentre: Crop from center\nattention: Smart crop focusing on interesting areas\nentropy: Crop to maximize entropy"
      },
      {
        "title": "3) Convert",
        "body": "Convert between image formats with quality control.\n\n# JPEG to WebP\npython scripts/vips_tool.py convert input.jpg output.webp --quality 85\n\n# PNG to AVIF (modern format, great compression)\npython scripts/vips_tool.py convert input.png output.avif --quality 50\n\n# JPEG to PNG (lossless)\npython scripts/vips_tool.py convert input.jpg output.png\n\n# With compression level for PNG\npython scripts/vips_tool.py convert input.jpg output.png --compression 9"
      },
      {
        "title": "4) Crop",
        "body": "Extract a region from an image.\n\n# Crop 400x300 region starting at (100, 50)\npython scripts/vips_tool.py crop input.jpg output.jpg --left 100 --top 50 --width 400 --height 300\n\n# Smart crop to aspect ratio\npython scripts/vips_tool.py crop input.jpg output.jpg --width 800 --height 600 --smart"
      },
      {
        "title": "5) Rotate",
        "body": "Rotate images by any angle.\n\n# Rotate 90 degrees clockwise\npython scripts/vips_tool.py rotate input.jpg output.jpg --angle 90\n\n# Rotate 45 degrees with background color\npython scripts/vips_tool.py rotate input.jpg output.jpg --angle 45 --background \"255,255,255\"\n\n# Auto-rotate based on EXIF\npython scripts/vips_tool.py rotate input.jpg output.jpg --auto"
      },
      {
        "title": "6) Watermark",
        "body": "Add text or image watermarks.\n\n# Text watermark\npython scripts/vips_tool.py watermark input.jpg output.jpg --text \"Copyright 2024\"\n\n# Position: top-left, top-right, bottom-left, bottom-right, center\npython scripts/vips_tool.py watermark input.jpg output.jpg --text \"Logo\" --position bottom-right\n\n# With opacity\npython scripts/vips_tool.py watermark input.jpg output.jpg --text \"Draft\" --opacity 0.3\n\n# Image watermark\npython scripts/vips_tool.py watermark input.jpg output.jpg --image logo.png --position bottom-right --opacity 0.5"
      },
      {
        "title": "7) Composite",
        "body": "Combine multiple images.\n\n# Overlay image on background\npython scripts/vips_tool.py composite background.jpg overlay.png output.jpg\n\n# With position offset\npython scripts/vips_tool.py composite background.jpg overlay.png output.jpg --x 100 --y 50\n\n# With blend mode\npython scripts/vips_tool.py composite background.jpg overlay.png output.jpg --blend multiply\n\nBlend modes: over, multiply, screen, overlay, darken, lighten"
      },
      {
        "title": "8) Adjust",
        "body": "Adjust brightness, contrast, saturation.\n\n# Increase brightness\npython scripts/vips_tool.py adjust input.jpg output.jpg --brightness 1.2\n\n# Increase contrast\npython scripts/vips_tool.py adjust input.jpg output.jpg --contrast 1.3\n\n# Increase saturation\npython scripts/vips_tool.py adjust input.jpg output.jpg --saturation 1.5\n\n# Combine adjustments\npython scripts/vips_tool.py adjust input.jpg output.jpg --brightness 1.1 --contrast 1.2 --saturation 1.1"
      },
      {
        "title": "9) Sharpen",
        "body": "Apply sharpening filter.\n\n# Default sharpen\npython scripts/vips_tool.py sharpen input.jpg output.jpg\n\n# Custom sigma (blur radius)\npython scripts/vips_tool.py sharpen input.jpg output.jpg --sigma 1.5\n\n# Custom parameters\npython scripts/vips_tool.py sharpen input.jpg output.jpg --sigma 1.5 --x1 2 --m2 3"
      },
      {
        "title": "10) Blur",
        "body": "Apply Gaussian blur.\n\n# Default blur\npython scripts/vips_tool.py blur input.jpg output.jpg\n\n# Custom sigma\npython scripts/vips_tool.py blur input.jpg output.jpg --sigma 5"
      },
      {
        "title": "11) Flip & Mirror",
        "body": "Flip images horizontally or vertically.\n\n# Horizontal flip (mirror)\npython scripts/vips_tool.py flip input.jpg output.jpg --horizontal\n\n# Vertical flip\npython scripts/vips_tool.py flip input.jpg output.jpg --vertical"
      },
      {
        "title": "12) Grayscale",
        "body": "Convert to grayscale.\n\npython scripts/vips_tool.py grayscale input.jpg output.jpg"
      },
      {
        "title": "13) Info",
        "body": "Get image metadata.\n\npython scripts/vips_tool.py info input.jpg\n\nOutput:\n\nFile: input.jpg\nFormat: jpeg\nWidth: 3840\nHeight: 2160\nBands: 3\nInterpretation: srgb\nSize: 2.4 MB"
      },
      {
        "title": "Batch Processing",
        "body": "Process multiple images at once.\n\n# Resize all JPEGs in a directory\npython scripts/vips_batch.py resize ./input ./output --width 800 --pattern \"*.jpg\"\n\n# Convert all images to WebP\npython scripts/vips_batch.py convert ./input ./output --format webp --quality 85\n\n# Create thumbnails for all images\npython scripts/vips_batch.py thumbnail ./input ./thumbnails --size 200\n\n# Custom batch with JSON config\npython scripts/vips_batch.py --config batch_config.json"
      },
      {
        "title": "Batch Config Format",
        "body": "{\n  \"input_dir\": \"./input\",\n  \"output_dir\": \"./output\",\n  \"operations\": [\n    {\"type\": \"resize\", \"width\": 1920},\n    {\"type\": \"sharpen\", \"sigma\": 0.5},\n    {\"type\": \"convert\", \"format\": \"webp\", \"quality\": 85}\n  ],\n  \"pattern\": \"*.{jpg,jpeg,png}\",\n  \"recursive\": true,\n  \"workers\": 4\n}"
      },
      {
        "title": "Basic Usage",
        "body": "import pyvips\n\n# Load image\nimage = pyvips.Image.new_from_file(\"input.jpg\")\n\n# Resize\nresized = image.resize(0.5)  # 50% scale\nresized = image.thumbnail_image(800)  # 800px width\n\n# Save\nresized.write_to_file(\"output.jpg\", Q=85)  # JPEG quality 85\nresized.write_to_file(\"output.webp\", Q=85)  # WebP quality 85"
      },
      {
        "title": "Chaining Operations",
        "body": "import pyvips\n\n# Load, process, save in one pipeline\nimage = pyvips.Image.new_from_file(\"input.jpg\", access=\"sequential\")\nresult = (\n    image\n    .thumbnail_image(1200)\n    .sharpen(sigma=0.5)\n    .write_to_file(\"output.webp\", Q=85)\n)"
      },
      {
        "title": "Watermark with Text",
        "body": "import pyvips\n\nimage = pyvips.Image.new_from_file(\"input.jpg\")\n\n# Create text overlay\ntext = pyvips.Image.text(\n    \"Copyright 2024\",\n    font=\"sans 24\",\n    rgba=True\n)\n\n# Composite at bottom-right\nx = image.width - text.width - 20\ny = image.height - text.height - 20\nresult = image.composite2(text, \"over\", x=x, y=y)\nresult.write_to_file(\"output.jpg\")"
      },
      {
        "title": "Batch Processing",
        "body": "import pyvips\nfrom pathlib import Path\nfrom concurrent.futures import ThreadPoolExecutor\n\ndef process_image(input_path, output_dir, width=800):\n    image = pyvips.Image.new_from_file(str(input_path), access=\"sequential\")\n    thumbnail = image.thumbnail_image(width)\n    output_path = output_dir / f\"{input_path.stem}.webp\"\n    thumbnail.write_to_file(str(output_path), Q=85)\n    return output_path\n\ninput_dir = Path(\"./input\")\noutput_dir = Path(\"./output\")\noutput_dir.mkdir(exist_ok=True)\n\nfiles = list(input_dir.glob(\"*.jpg\"))\nwith ThreadPoolExecutor(max_workers=4) as executor:\n    results = executor.map(lambda f: process_image(f, output_dir), files)"
      },
      {
        "title": "CLI Parameters",
        "body": "ParameterDescriptionDefault--widthTarget width in pixels---heightTarget height in pixels---sizeThumbnail size (square)200--qualityOutput quality (1-100)85--compressionPNG compression (0-9)6--modeResize mode: fit, cover, forcefit--cropCrop strategynone--angleRotation angle in degrees0--sigmaBlur/sharpen radius1.0--opacityWatermark opacity (0-1)0.5--positionWatermark positionbottom-right--workersBatch processing threads4--patternFile glob pattern.--recursiveProcess subdirectoriesfalse"
      },
      {
        "title": "Performance Tips",
        "body": "TipDescriptionSequential accessUse access=\"sequential\" for streamingPipeline operationsChain operations before writingParallel processingUse ThreadPoolExecutor for batchesFormat selectionWebP/AVIF for web, JPEG for photosQuality settings85 for quality, 75 for sizeThumbnail vs resizethumbnail_image is faster for downscaling"
      },
      {
        "title": "Memory Usage",
        "body": "libvips uses a streaming architecture:\n\nOnly loads pixels when needed\nProcesses images in small chunks\nMemory usage independent of image size\n10-100x less memory than ImageMagick/PIL for large images"
      },
      {
        "title": "Common Issues",
        "body": "IssueSolution\"Cannot find libvips\"Install via brew/apt, check PATHSlow processingUse sequential access, check disk I/OMemory errorsIncrease cache, reduce workersFormat not supportedInstall optional dependenciesPoor qualityIncrease quality parameterHEIC not workingInstall libheif: brew install libheifSVG not renderingInstall librsvg: brew install librsvg"
      },
      {
        "title": "Windows-Specific Issues",
        "body": "IssueSolution\"cannot load library 'libvips-42.dll'\"Add vips bin\\ folder to PATHDLL not found after installRestart terminal/PowerShellwinget install failsUse manual download or scoopPermission deniedRun PowerShell as AdministratorPATH not updatedLog out and log back in, or restart\n\nWindows PATH Setup (Manual):\n\n# Add to current session\n$env:PATH = \"C:\\vips\\bin;$env:PATH\"\n\n# Add permanently (run as Admin or for current user)\n[Environment]::SetEnvironmentVariable(\"PATH\", \"C:\\vips\\bin;$env:PATH\", \"User\")"
      },
      {
        "title": "macOS-Specific Issues",
        "body": "IssueSolution\"cannot load library 'libvips.42.dylib'\"Use ./scripts/run.sh wrapperDYLD_LIBRARY_PATH not workingmacOS SIP blocks env vars; use run.shHomebrew Python issuesUse /opt/homebrew/bin/python3 directly\n\nmacOS Library Path Setup:\n\n# Add to ~/.zshrc or ~/.bashrc\nexport DYLD_LIBRARY_PATH=\"/opt/homebrew/lib:$DYLD_LIBRARY_PATH\""
      },
      {
        "title": "Linux-Specific Issues",
        "body": "IssueSolutionPackage not foundCheck distro-specific package nameldconfig issuesRun sudo ldconfig after installPermission deniedUse sudo for system packages"
      }
    ],
    "body": "libvips Image Processing\n\nFast, memory-efficient image processing using libvips via pyvips. Supports 300+ operations including resize, crop, rotate, convert, watermark, composite, and more. Ideal for batch processing large images.\n\nWhen to Use\nResize, crop, or thumbnail images efficiently\nConvert between formats (JPEG, PNG, WebP, AVIF, HEIC, TIFF, PDF, SVG)\nAdd watermarks or text overlays\nBatch process multiple images\nHandle large images with low memory usage\nCreate image pipelines for web optimization\nQuick Start\nInstall (One-Click)\n# Recommended: Auto-detect OS and install everything\n./scripts/install.sh\n\n\nThe install script will:\n\nDetect your OS (macOS, Linux, Windows)\nInstall libvips system library\nInstall pyvips via uv (preferred) or pip\nVerify the installation\nManual Install\n\nmacOS (Homebrew):\n\nbrew install vips\nuv pip install pyvips  # preferred\n# or: pip install pyvips\n\n\nUbuntu/Debian:\n\nsudo apt-get install libvips-dev\nuv pip install pyvips  # preferred\n# or: pip install pyvips\n\n\nFedora/RHEL:\n\nsudo dnf install vips-devel\nuv pip install pyvips\n\n\nArch Linux:\n\nsudo pacman -S libvips\nuv pip install pyvips\n\n\nWindows (PowerShell, recommended):\n\n# One-click install (downloads libvips + installs pyvips)\n.\\scripts\\install.ps1\n\n\nWindows (Manual):\n\n# Option 1: winget (if available)\nwinget install libvips.libvips\n\n# Option 2: scoop\nscoop install libvips\n\n# Option 3: Manual download\n# Download from https://github.com/libvips/libvips/releases\n# Extract to C:\\vips or %LOCALAPPDATA%\\vips\n# Add bin\\ to PATH\n\n# Install pyvips\nuv pip install pyvips\n# or: pip install pyvips\n\n\nInstall uv (if not installed):\n\n# macOS/Linux\ncurl -LsSf https://astral.sh/uv/install.sh | sh\n\n# Windows (PowerShell)\nirm https://astral.sh/uv/install.ps1 | iex\n\nBasic Usage\n\nmacOS/Linux - Using run.sh wrapper (recommended):\n\n./scripts/run.sh vips_tool.py resize input.jpg output.jpg --width 800\n./scripts/run.sh vips_tool.py convert input.jpg output.webp --quality 85\n./scripts/run.sh vips_tool.py thumbnail input.jpg thumb.jpg --size 200\n./scripts/run.sh vips_batch.py resize ./input ./output --width 800\n\n\nWindows - Using run.bat wrapper (recommended):\n\n.\\scripts\\run.bat vips_tool.py resize input.jpg output.jpg --width 800\n.\\scripts\\run.bat vips_tool.py convert input.jpg output.webp --quality 85\n.\\scripts\\run.bat vips_tool.py thumbnail input.jpg thumb.jpg --size 200\n.\\scripts\\run.bat vips_batch.py resize .\\input .\\output --width 800\n\n\nCross-platform - Using uv (after uv sync):\n\nuv run python scripts/vips_tool.py resize input.jpg output.jpg --width 800\n\n\nDirect Python (if library paths are configured):\n\npython scripts/vips_tool.py resize input.jpg output.jpg --width 800\npython scripts/vips_tool.py convert input.jpg output.webp --quality 85\npython scripts/vips_tool.py thumbnail input.jpg thumb.jpg --size 200\npython scripts/vips_tool.py watermark input.jpg output.jpg --text \"Copyright 2024\"\n\nSupported Formats\nFormat\tRead\tWrite\tNotes\nJPEG\tYes\tYes\tQuality 1-100\nPNG\tYes\tYes\tCompression 0-9\nWebP\tYes\tYes\tLossy/lossless\nAVIF\tYes\tYes\tModern, high compression\nHEIC\tYes\tYes\tApple format\nTIFF\tYes\tYes\tMulti-page support\nGIF\tYes\tYes\tAnimated support\nPDF\tYes\tYes\tVia poppler\nSVG\tYes\tNo\tVia librsvg\nRAW\tYes\tNo\tVia libraw\nOperations\n1) Resize\n\nResize images with various fit modes.\n\n# Resize to exact width, maintain aspect ratio\npython scripts/vips_tool.py resize input.jpg output.jpg --width 800\n\n# Resize to exact height\npython scripts/vips_tool.py resize input.jpg output.jpg --height 600\n\n# Resize to fit within bounds\npython scripts/vips_tool.py resize input.jpg output.jpg --width 800 --height 600\n\n# Resize to cover (fill) dimensions\npython scripts/vips_tool.py resize input.jpg output.jpg --width 800 --height 600 --mode cover\n\n# Force exact dimensions (may distort)\npython scripts/vips_tool.py resize input.jpg output.jpg --width 800 --height 600 --mode force\n\n\nResize modes:\n\nfit (default): Fit within bounds, maintain aspect ratio\ncover: Cover bounds, crop excess\nforce: Force exact dimensions\n2) Thumbnail\n\nCreate optimized thumbnails with smart cropping.\n\n# Square thumbnail\npython scripts/vips_tool.py thumbnail input.jpg thumb.jpg --size 200\n\n# Attention-based smart crop\npython scripts/vips_tool.py thumbnail input.jpg thumb.jpg --size 200 --crop attention\n\n# Center crop\npython scripts/vips_tool.py thumbnail input.jpg thumb.jpg --size 200 --crop centre\n\n\nCrop strategies:\n\nnone: No cropping, fit within size\ncentre: Crop from center\nattention: Smart crop focusing on interesting areas\nentropy: Crop to maximize entropy\n3) Convert\n\nConvert between image formats with quality control.\n\n# JPEG to WebP\npython scripts/vips_tool.py convert input.jpg output.webp --quality 85\n\n# PNG to AVIF (modern format, great compression)\npython scripts/vips_tool.py convert input.png output.avif --quality 50\n\n# JPEG to PNG (lossless)\npython scripts/vips_tool.py convert input.jpg output.png\n\n# With compression level for PNG\npython scripts/vips_tool.py convert input.jpg output.png --compression 9\n\n4) Crop\n\nExtract a region from an image.\n\n# Crop 400x300 region starting at (100, 50)\npython scripts/vips_tool.py crop input.jpg output.jpg --left 100 --top 50 --width 400 --height 300\n\n# Smart crop to aspect ratio\npython scripts/vips_tool.py crop input.jpg output.jpg --width 800 --height 600 --smart\n\n5) Rotate\n\nRotate images by any angle.\n\n# Rotate 90 degrees clockwise\npython scripts/vips_tool.py rotate input.jpg output.jpg --angle 90\n\n# Rotate 45 degrees with background color\npython scripts/vips_tool.py rotate input.jpg output.jpg --angle 45 --background \"255,255,255\"\n\n# Auto-rotate based on EXIF\npython scripts/vips_tool.py rotate input.jpg output.jpg --auto\n\n6) Watermark\n\nAdd text or image watermarks.\n\n# Text watermark\npython scripts/vips_tool.py watermark input.jpg output.jpg --text \"Copyright 2024\"\n\n# Position: top-left, top-right, bottom-left, bottom-right, center\npython scripts/vips_tool.py watermark input.jpg output.jpg --text \"Logo\" --position bottom-right\n\n# With opacity\npython scripts/vips_tool.py watermark input.jpg output.jpg --text \"Draft\" --opacity 0.3\n\n# Image watermark\npython scripts/vips_tool.py watermark input.jpg output.jpg --image logo.png --position bottom-right --opacity 0.5\n\n7) Composite\n\nCombine multiple images.\n\n# Overlay image on background\npython scripts/vips_tool.py composite background.jpg overlay.png output.jpg\n\n# With position offset\npython scripts/vips_tool.py composite background.jpg overlay.png output.jpg --x 100 --y 50\n\n# With blend mode\npython scripts/vips_tool.py composite background.jpg overlay.png output.jpg --blend multiply\n\n\nBlend modes: over, multiply, screen, overlay, darken, lighten\n\n8) Adjust\n\nAdjust brightness, contrast, saturation.\n\n# Increase brightness\npython scripts/vips_tool.py adjust input.jpg output.jpg --brightness 1.2\n\n# Increase contrast\npython scripts/vips_tool.py adjust input.jpg output.jpg --contrast 1.3\n\n# Increase saturation\npython scripts/vips_tool.py adjust input.jpg output.jpg --saturation 1.5\n\n# Combine adjustments\npython scripts/vips_tool.py adjust input.jpg output.jpg --brightness 1.1 --contrast 1.2 --saturation 1.1\n\n9) Sharpen\n\nApply sharpening filter.\n\n# Default sharpen\npython scripts/vips_tool.py sharpen input.jpg output.jpg\n\n# Custom sigma (blur radius)\npython scripts/vips_tool.py sharpen input.jpg output.jpg --sigma 1.5\n\n# Custom parameters\npython scripts/vips_tool.py sharpen input.jpg output.jpg --sigma 1.5 --x1 2 --m2 3\n\n10) Blur\n\nApply Gaussian blur.\n\n# Default blur\npython scripts/vips_tool.py blur input.jpg output.jpg\n\n# Custom sigma\npython scripts/vips_tool.py blur input.jpg output.jpg --sigma 5\n\n11) Flip & Mirror\n\nFlip images horizontally or vertically.\n\n# Horizontal flip (mirror)\npython scripts/vips_tool.py flip input.jpg output.jpg --horizontal\n\n# Vertical flip\npython scripts/vips_tool.py flip input.jpg output.jpg --vertical\n\n12) Grayscale\n\nConvert to grayscale.\n\npython scripts/vips_tool.py grayscale input.jpg output.jpg\n\n13) Info\n\nGet image metadata.\n\npython scripts/vips_tool.py info input.jpg\n\n\nOutput:\n\nFile: input.jpg\nFormat: jpeg\nWidth: 3840\nHeight: 2160\nBands: 3\nInterpretation: srgb\nSize: 2.4 MB\n\nBatch Processing\n\nProcess multiple images at once.\n\n# Resize all JPEGs in a directory\npython scripts/vips_batch.py resize ./input ./output --width 800 --pattern \"*.jpg\"\n\n# Convert all images to WebP\npython scripts/vips_batch.py convert ./input ./output --format webp --quality 85\n\n# Create thumbnails for all images\npython scripts/vips_batch.py thumbnail ./input ./thumbnails --size 200\n\n# Custom batch with JSON config\npython scripts/vips_batch.py --config batch_config.json\n\nBatch Config Format\n{\n  \"input_dir\": \"./input\",\n  \"output_dir\": \"./output\",\n  \"operations\": [\n    {\"type\": \"resize\", \"width\": 1920},\n    {\"type\": \"sharpen\", \"sigma\": 0.5},\n    {\"type\": \"convert\", \"format\": \"webp\", \"quality\": 85}\n  ],\n  \"pattern\": \"*.{jpg,jpeg,png}\",\n  \"recursive\": true,\n  \"workers\": 4\n}\n\nPython API\nBasic Usage\nimport pyvips\n\n# Load image\nimage = pyvips.Image.new_from_file(\"input.jpg\")\n\n# Resize\nresized = image.resize(0.5)  # 50% scale\nresized = image.thumbnail_image(800)  # 800px width\n\n# Save\nresized.write_to_file(\"output.jpg\", Q=85)  # JPEG quality 85\nresized.write_to_file(\"output.webp\", Q=85)  # WebP quality 85\n\nChaining Operations\nimport pyvips\n\n# Load, process, save in one pipeline\nimage = pyvips.Image.new_from_file(\"input.jpg\", access=\"sequential\")\nresult = (\n    image\n    .thumbnail_image(1200)\n    .sharpen(sigma=0.5)\n    .write_to_file(\"output.webp\", Q=85)\n)\n\nWatermark with Text\nimport pyvips\n\nimage = pyvips.Image.new_from_file(\"input.jpg\")\n\n# Create text overlay\ntext = pyvips.Image.text(\n    \"Copyright 2024\",\n    font=\"sans 24\",\n    rgba=True\n)\n\n# Composite at bottom-right\nx = image.width - text.width - 20\ny = image.height - text.height - 20\nresult = image.composite2(text, \"over\", x=x, y=y)\nresult.write_to_file(\"output.jpg\")\n\nBatch Processing\nimport pyvips\nfrom pathlib import Path\nfrom concurrent.futures import ThreadPoolExecutor\n\ndef process_image(input_path, output_dir, width=800):\n    image = pyvips.Image.new_from_file(str(input_path), access=\"sequential\")\n    thumbnail = image.thumbnail_image(width)\n    output_path = output_dir / f\"{input_path.stem}.webp\"\n    thumbnail.write_to_file(str(output_path), Q=85)\n    return output_path\n\ninput_dir = Path(\"./input\")\noutput_dir = Path(\"./output\")\noutput_dir.mkdir(exist_ok=True)\n\nfiles = list(input_dir.glob(\"*.jpg\"))\nwith ThreadPoolExecutor(max_workers=4) as executor:\n    results = executor.map(lambda f: process_image(f, output_dir), files)\n\nCLI Parameters\nParameter\tDescription\tDefault\n--width\tTarget width in pixels\t-\n--height\tTarget height in pixels\t-\n--size\tThumbnail size (square)\t200\n--quality\tOutput quality (1-100)\t85\n--compression\tPNG compression (0-9)\t6\n--mode\tResize mode: fit, cover, force\tfit\n--crop\tCrop strategy\tnone\n--angle\tRotation angle in degrees\t0\n--sigma\tBlur/sharpen radius\t1.0\n--opacity\tWatermark opacity (0-1)\t0.5\n--position\tWatermark position\tbottom-right\n--workers\tBatch processing threads\t4\n--pattern\tFile glob pattern\t.\n--recursive\tProcess subdirectories\tfalse\nPerformance Tips\nTip\tDescription\nSequential access\tUse access=\"sequential\" for streaming\nPipeline operations\tChain operations before writing\nParallel processing\tUse ThreadPoolExecutor for batches\nFormat selection\tWebP/AVIF for web, JPEG for photos\nQuality settings\t85 for quality, 75 for size\nThumbnail vs resize\tthumbnail_image is faster for downscaling\nMemory Usage\n\nlibvips uses a streaming architecture:\n\nOnly loads pixels when needed\nProcesses images in small chunks\nMemory usage independent of image size\n10-100x less memory than ImageMagick/PIL for large images\nTroubleshooting\nCommon Issues\nIssue\tSolution\n\"Cannot find libvips\"\tInstall via brew/apt, check PATH\nSlow processing\tUse sequential access, check disk I/O\nMemory errors\tIncrease cache, reduce workers\nFormat not supported\tInstall optional dependencies\nPoor quality\tIncrease quality parameter\nHEIC not working\tInstall libheif: brew install libheif\nSVG not rendering\tInstall librsvg: brew install librsvg\nWindows-Specific Issues\nIssue\tSolution\n\"cannot load library 'libvips-42.dll'\"\tAdd vips bin\\ folder to PATH\nDLL not found after install\tRestart terminal/PowerShell\nwinget install fails\tUse manual download or scoop\nPermission denied\tRun PowerShell as Administrator\nPATH not updated\tLog out and log back in, or restart\n\nWindows PATH Setup (Manual):\n\n# Add to current session\n$env:PATH = \"C:\\vips\\bin;$env:PATH\"\n\n# Add permanently (run as Admin or for current user)\n[Environment]::SetEnvironmentVariable(\"PATH\", \"C:\\vips\\bin;$env:PATH\", \"User\")\n\nmacOS-Specific Issues\nIssue\tSolution\n\"cannot load library 'libvips.42.dylib'\"\tUse ./scripts/run.sh wrapper\nDYLD_LIBRARY_PATH not working\tmacOS SIP blocks env vars; use run.sh\nHomebrew Python issues\tUse /opt/homebrew/bin/python3 directly\n\nmacOS Library Path Setup:\n\n# Add to ~/.zshrc or ~/.bashrc\nexport DYLD_LIBRARY_PATH=\"/opt/homebrew/lib:$DYLD_LIBRARY_PATH\"\n\nLinux-Specific Issues\nIssue\tSolution\nPackage not found\tCheck distro-specific package name\nldconfig issues\tRun sudo ldconfig after install\nPermission denied\tUse sudo for system packages"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/h1bomb/libvips-image",
    "publisherUrl": "https://clawhub.ai/h1bomb/libvips-image",
    "owner": "h1bomb",
    "version": "0.1.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/libvips-image",
    "downloadUrl": "https://openagent3.xyz/downloads/libvips-image",
    "agentUrl": "https://openagent3.xyz/skills/libvips-image/agent",
    "manifestUrl": "https://openagent3.xyz/skills/libvips-image/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/libvips-image/agent.md"
  }
}