SDK Recipes›AI Face Privacy → Detect → Mosaic → Compress
AI Photo Workflow

AI Face Privacy → Detect → Mosaic → Compress

Automatically detect visible faces, apply a privacy mosaic, then compress the protected image for delivery.

ai-face-blur
→
compress-image
InputJPG / PNG / WebP
Final resultProtected image File
Tools usedai-face-blur → compress-image

Complete code

const protectedResult = await client.run("ai-face-blur", {
  file: sourcePhoto,
  options: {
    mode: "mosaic",
    strength: 28
  }
});

const compressed = await client.run("compress-image", {
  file: protectedResult.files[0],
  options: {
    format: "webp",
    quality: 0.82
  }
});

const finalFile = compressed.files[0];
Before adapting this recipe, use client.describe(toolId) or the Tool Reference page to verify exact file limits, option values, and supported modes.