/image-production:auto-white-balancefrom image-production
Automatically corrects white balance of images (JPEG/PNG/TIFF/WebP) using gray-world, white-patch, or combined algorithms via ImageMagick. Supports batch processing, adjustable strength, and luminance preservation.
Ships in image-production. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Neutralise colour casts without per-image manual correction. Three algorithms, one CLI.
-auto-level stretches each channel to full range. Strong correction; fails on scenes lacking a true white reference.Do not use this skill when:
darktable-cli with --apply-custom-presets and the temperature module set to as shot to reference. White-balancing a baked JPEG throws away headroom that's still in the RAW.gray-world (default) | white-patch | combined.--recursive for directory descent._wb next to the source. --output-dir <path> to write into a sibling folder. --overwrite to replace.0.0 to 1.0 (default 1.0). Blends the corrected image with the original via -compose blend -define compose:args=<pct>. Use 0.5 for a softer touch.on. After channel scaling, rescale so the mean luminance matches the original (prevents brightness drift). --no-preserve-luma to disable.Verify ImageMagick 7+. magick -version | head -1. Fall back to convert (IM6) if magick is missing — the syntax below works on both with the leading binary swapped. If neither, point at install-deps.
Enumerate inputs. Accept JPEG/JPG/PNG/TIFF/TIF/WebP. Skip and note RAW formats.
gray-world:
magick "$IN" \
-colorspace sRGB \
-channel R -evaluate multiply $(magick "$IN" -colorspace sRGB -format "%[fx:mean/mean.r]" info:) \
-channel G -evaluate multiply $(magick "$IN" -colorspace sRGB -format "%[fx:mean/mean.g]" info:) \
-channel B -evaluate multiply $(magick "$IN" -colorspace sRGB -format "%[fx:mean/mean.b]" info:) \
+channel "$OUT"
Each fx:mean/mean.<c> is the gain that drives that channel's mean to the global mean. Three info: calls is wasteful for batch — cache via a single magick identify -format "%[fx:mean] %[fx:mean.r] %[fx:mean.g] %[fx:mean.b]" "$IN" and compute gains in shell.
white-patch:
magick "$IN" -channel RGB -auto-level +channel "$OUT"
Independent per-channel histogram stretch to [0,1]. Aggressive; clips highlights if any channel already saturates.
combined:
Run gray-world to a temp file, then:
magick "$TMP" \( +clone -channel RGB -auto-level +channel \) \
-compose blend -define compose:args=50 -composite "$OUT"
Preserve luminance (when enabled): after step 3/4/5, measure luminance before and after and rescale:
L_IN=$(magick "$IN" -colorspace Gray -format "%[fx:mean]" info:)
L_OUT=$(magick "$WB" -colorspace Gray -format "%[fx:mean]" info:)
GAIN=$(awk "BEGIN{print $L_IN/$L_OUT}")
magick "$WB" -evaluate multiply "$GAIN" "$OUT"
Strength blend (when <1.0):
magick "$IN" "$WB" -compose blend -define compose:args=$(awk "BEGIN{print $STRENGTH*100}") -composite "$OUT"
For batch, parallelise with xargs -P $(nproc) over the file list. Skip files that already end in _wb to avoid recursive re-processing.
white-patch is more honest, or skip auto-WB entirely and use a colour picker on a known-neutral patch.combined at --strength 0.7 — strong enough to neutralise obvious casts, weak enough to preserve scene character.-profile sRGB.icc explicitly if the pipeline downstream is profile-strict.apply-filters may call it as one step; this skill exists to do WB-only work without the rest of the pipeline.What SKILL.md sets; muted values are Claude Code's defaults
38 skills in this plugin
/ai-graphicsGenerate AI graphics (banners, illustrations, hero images, social cards, characters, etc.) on fal, or Replicate if asked, choosing a cost-effective model per use case. Use when the user asks to create, generate, or make an image, banner, illustration, graphic, or artwork, or to redraw a reference image. For technical diagrams use tech-comms-diagrams./auto-deskewUse when the user wants to automatically straighten a tilted image — scanned documents, phone-captured pages, photographed receipts, or slightly off-axis photos. Detects the dominant skew angle and rotates the image to vertical/horizontal, optionally cropping the resulting transparent triangles. Uses ImageMagick `-deskew` for documents and a Hough-line fallback (via Python + OpenCV) for photographs./auto-toneUse when the user wants automatic tonal correction — fix flat/washed-out / underexposed / low-contrast images by stretching levels, normalising contrast, and gamma-correcting to a neutral midtone. Implements auto-level (per-channel histogram stretch), auto-gamma (midtone correction), and a combined "punch" mode via ImageMagick. Operates on JPEG/PNG/TIFF/WebP./batch-set-copyrightBatch-stamp copyright, artist, and rights information on all images in a directory. Use when you need to quickly add copyright metadata to a photo library before distribution or archival — a convenience wrapper around exiftool./check-model-pricingCheck what an image model costs on fal (default) or Replicate, search fal's library for a model, and review or update the preferred image models per use case. Use when asked "how much is this model", "what's cheapest for X", "check fal pricing", "review the fal library", "update our preferred models", or before a bulk image run./configure-rmbgUse when the user wants to change default model, output naming, or GPU acceleration settings.image-production@danielrosehill is listed by danielrosehill/claude-code-plugins — review the source before installing
npx claudepluginhub danielrosehill/claude-code-plugins --plugin image-productionOther plugins' skills for the same job