photo-edit — Photographer-Style Photo Editing
A Lightroom panel (Basic, Tone Curve, HSL, Color Grading, Detail, Effects, B&W, Local Masks) implemented in numpy/OpenCV. Parameter names and ranges match Lightroom exactly, so every resulting image comes with a readable recipe that can also be exported as a Lightroom preset.
The core of editing is the AI assistant using its own eyes. The script handles the calculations; the AI assistant handles the judgment: in each round, use the current environment's image viewer to open the side-by-side rendering, check it against a checklist, adjust parameters, then review again. Never deliver without looking at the image.
Environment & Tool Adaptation (Check at Start of Each Session)
This workflow is intended for AI assistants that can read local files, execute commands, and view images. Tool names are determined by the host environment; it does not rely on any product-specific Read or shell tool. If you only have text capabilities or cannot execute commands, the user should run the CLI and provide side-by-side comparisons; if you have not viewed an image, explicitly state that visual inspection is incomplete.
- Confirm the operating system, shell, project absolute path, available Python/uv, and image viewing capabilities.
SKILL_DIRrefers to the folder containing this file; do not assume any AI product's installation directory. First change to this directory and runuv run scripts/pe.py doctor. Hereafter,pe.pyis shorthand foruv run scripts/pe.py. If using Python with installed dependencies, usepythonon Windows andpython3on macOS/Linux; verify which command works.- Read the Runtime Guide and choose additional dependencies based on the current function. PEP 723 only installs core packages; optional dependencies require
uv run --with package scripts/pe.py ...; do not assume global pip installs will enter uv's isolation environment. - Culling → Analysis → Style Board → Preview → Visual Check → Correction → Full-Resolution Output: this flow is shared across all three platforms. macOS-specific Photos app and matte extraction run only when needed; Windows/Linux use user-provided photo folders; if
.mattessidecar files already exist, they are read along with the images. - Quote paths containing spaces; use UTF-8 for photo lists, JSON, and reports. Use
@"out/cull/picks.txt"for PowerShell list parameters; prefer writing JSON to a UTF-8 file before passing it to--adjust/--per-fileto avoid shell quote issues. - Below,
photosis an example input folder; replace with the actual path. UseE:/DCIMon Windows, the actual mount path on Linux/macOS. Use the project'sout/or system temp for temporary output; do not hardcode/tmp. Default output root isPictures/PhotoEditunder the user's home directory; use-oto override. - Album organization outputs only a report by default; on Windows, use
--apply copyto create physical category folders, and--apply linkonly if the environment supports symbolic links. Do not ask for elevated privileges for this feature.
Personal Aesthetic File (Read at Start of Each Session)
~/.config/photo-edit/taste.md: The user's editing preferences (what they like/dislike, styles they've chosen before, reasons photos were rejected).
- Read it at startup; if it exists, use it as default; otherwise, follow general principles.
- When the user gives feedback (e.g., "face too red," "sky shouldn't be gray," "choose A for this set"), propose one line to add when delivering, and only write it after the user agrees. Write specific, opinionated sentences, not "I like nice looking."
Principles
- Never overwrite originals. SD cards and albums are read-only. Output default is
~/Pictures/PhotoEdit/<folder>_<style>/, with a.recipe.jsonnext to each image. - Correct first, then style (photographer's order): per-image auto correction (exposure, white balance, highlight/shadow recovery, ISO-dependent noise reduction, backlit subject mask) + shared batch style + individual tweaks.
Stacking rules: Basic panel sliders (exposure/temp/contrast/highlights…) are additive; HSL, curves, grading, etc., are overrides; the
maskslist is concatenated (samenameis replaced). - One style per batch to look like it was edited by the same photographer; split into a second style for drastically different scenes like night/indoor.
- Better subtle, but obvious. Professional results rarely scream "filter applied"; but no difference from the original is also a failure. Skin, sky, white objects, and deep anchors are the most telltale spots.
- Global first, local later. Only use masks (see "Local Masks") when global sliders can't fix an issue and forcing them would damage other areas.
Editing Discipline (Applies to Every Image)
A. Before editing, write a "visual brief" (3–5 lines, ordered by importance, in your own notes):
- Light/dark structure: Where is the subject? Where are the bright and dark blocks? Are they well-separated or not? What is caused by lighting, and what can be changed in post?
- Black/white points and subject contrast: Are the dark anchors (asphalt, shadows, hair) deep enough? Are the whites bright enough? Is there enough contrast within the subject?
- Color, by material and luminance zone: What colors are present in what materials, and how strong? Which neutrals must remain neutral (white walls, gray skies, skin)?
- Texture last: Grain, haze, soft focus are texture, they cannot fix incorrect tonal relationships. Final sentence: "The biggest problem with this image is ______, I will edit towards ______, I must protect ______."
B. Every modification must be written as a one-line statement: "problem → expected improvement → potential cost", e.g., "Face too dark → subject mask +0.8EV → may cause a halo around the hat brim, need to check mask overlay." If you can't articulate the problem, don't touch it.
C. Round limit: First round: a complete, coherent version. After reviewing, at most one more round of targeted corrections. Third round only for real defects (destroyed skin, halos, blown whites) or user requests.
If two consecutive rounds show no clear improvement, stop and deliver the best version, not the last version (older recipe versions are in .recipe.json and can be reverted).
D. Don't do the same thing twice. Pushing highlights, whites, and the curve shoulder down together will make whites gray; pulling shadows, blacks, and the curve toe up together will make dark anchors disappear. Before adjusting, know which control is in charge.
Workflow
0. Culling (Do this first if photos exceed ~30)
pe.py cull "photos" -o out/cull
- The script handles technical aspects: group burst shots by capture time + visual similarity → reject (blurry, too dark to save, large overexposed areas) → rank within group by sharpness + exposure →
picks.txt(1st in each group) +cull.json. 1662 photos take about 6–7 minutes; results are cached, and re-running only processes new photos.--gapseconds /--max-hashsimilarity threshold can adjust grouping sensitivity. - The AI assistant handles the decisive moment: use an image viewer to open the generated
bursts_*.jpg(one burst row per line; green box = technical pick, red box = rejected). For groups with people, evaluate and override the technical pick based on these weights: Decisive moment & emotion 30%, Clear focus 20%, Exposure 15%, Composition 15%, Light & shadow 10%, Color 5%, Cleanliness 5%.- Veto items: closed eyes, large face obstruction, blurry subject, distorted expression (look at faces, not thumbnail impressions).
- "Decisive moment" is the peak of action or expression, not "in motion"; the shot looking at the camera, smiling, with hands in place usually wins over a transitional frame with turned head.
- Then open
picks_*.jpgwith an image viewer for overall selection: keep only the best from repeated scenes; remove dull record shots. If the user specifies a number of picks, select that many; otherwise deliver all selected picks and explain how many were removed and why. - Write the final list to a file (one path per line), then process with
pe.py develop "@final.txt" .... - Real-world experience (1645 travel photos → 158 picks):
- For photos with faces, sharpness is measured on the face (a photo with a sharp background but blurry face is rejected); a face close-up is included in the bottom-right corner of the overview so expressions can be seen without zooming.
- About 40% of person groups require overriding the technical pick: the technical score often selects a shot with turned head, speaking on the phone, or where the person is very small.
- The final selection round uses a high-density overview with 64-grid images (
pe.py contact). Criteria: keep the best 1–3 from each location, delete same-angle duplicates and pure record shots; most cuts come from repeated themes like zoo/museum. - Photos taken with the camera held vertically but without orientation info will appear sideways; add
"rotate": 90(or 270) to fix.
0.5 Extracting Photos from macOS "Photos" Library (When the user says "that trip in my Photos")
- macOS only; skip this section on Windows/Linux. Use an exported or synced local folder instead.
- The Photos library database (
Photos.sqlite) is blocked by macOS permissions and cannot be read or copied → use AppleScript/JXA to control the "Photos" app. - Find the date range: with JXA, read all
mediaItems()attributes (date(),location(),filename())—about 26,000 photos in 1 minute—then filter by GPS range + dates to identify the trip. Duplicates (same filename and time) are common; deduplicate by "filename + time." - Export:
tell application "Photos" to export {media item id "..."} to (POSIX file DIR as alias), always wrap withwith timeout of 1800 seconds: Originals only in iCloud need to download first; the default 2-minute timeout will cause a silent batch failure. Addwith using originalsto retrieve iPhone mattes (see "Portrait Retouching"). - When disk space is around 5–6GB, Photos stops downloading from iCloud; export reports success but no file is created; downloaded originals also stay in the library consuming space. So don't export everything at once: the user's preferred mode is "around 100 photos per batch: export → cull → edit → import into iCloud album → delete local copies," keeping only the current batch locally.
- First export 2048px thumbnails for culling, then export full-resolution for selected picks. HEIC can be passed directly to
pe.py(reads natively withpillow-heifinstalled, or automatically converts withsips).
0.8 RAW Files (ARW / DNG / CR3 / NEF / RAF…)
If RAW is available, use RAW: all pe.py commands directly consume RAW (add --with rawpy with uv; install rawpy in a virtual environment if using one). Highlights and shadows have much more recoverable range compared to JPG.
- Solution: rawpy (LibRaw) decodes with camera white balance, linear 16-bit, then applies a "camera baseline curve": align midtone brightness with the camera's embedded JPG (each camera's metering differs; the embedded JPG is what the camera considers "normal"), plus a light S-curve and saturation (similar to Lightroom's Adobe Color profile).
- EXIF (ISO, lens, time) is read from the embedded JPG; ISO noise reduction and
--consistentgrouping work as usual. Preview (--preview/analysis) uses half-size decoding, very fast; full resolution 24MP takes about 15–20 seconds. - No lens correction: camera JPGs correct distortion and vignetting; rawpy does not. For wide-angle architectural shots with barrel distortion, use
straighten/cropto correct, or accept. - When both RAW and JPG exist, use JPG for culling (fast), and the same-named RAW for editing.
1. Understand This Batch of Photos
pe.py contact "@final.txt" -o out/contact.jpg --cols 8 # or directory, glob
pe.py analyze IMG1 IMG2 ... # exposure stats, scene labels (night / backlit / foggy / people / foliage…), auto_correction
Determine: what was shot (travel / portrait / street / landscape / night), lighting (overcast, backlit, tungsten), common issues (gray, dark, tilted, noisy).
2. Choose a Style
- If the user specifies a style, photographer, or reference image → follow it (see step 5 for reference images).
- Otherwise, pick 2–3 representative photos to create a style board:
Open the style board with an image viewer. Choose based onpe.py board IMG --size 700 -o out/board.jpg # all styles pe.py board IMG --styles moody-autumn,film-portra,cinematic-teal-orangepe.py stylesand the "Scene → Style Recommendations" inreferences/editing-guide.md; if unsure, show the style board to the user with 2–3 recommendations (AskUserQuestion). - Style strength:
--strength 0.6(subtle) to1.2(strong), corresponding to Lightroom preset Amount.
3. Preview + Per-Image Check (Most Important)
pe.py develop IMG... --style STYLE --preview 1200 -o out/preview # 1200px, <1 sec per image
pe.py review ORIGINAL_DIR out/preview --per-sheet 6 # full batch "original | edited" pair layout
pe.py compare ORIG v1.jpg v2.jpg --labels "orig|v1|v2" --sep "|" -o out/cmp.jpg
Open each review sheet with an image viewer. Compare against the "visual brief" from Discipline A, and check each item in the checklists and failure signals from references/editing-guide.md.
For areas of concern (skin, edges, sky gradients, noise), inspect at 100% cropped detail; thumbnails cannot reveal halos or color banding.
Real-world experience (same batch of travel photos):
- Film/haze style × overcast sky: lifting blacks + warm colors turns a gray sky into beige, making the whole image hazy. For overcast photos with a "low-saturation, bright upper 1/5th," add
{"temp": -7, "contrast": 12, "blacks": -10, "dehaze": 8, "vibrance": 6}. - Sunset silhouettes: auto correction will lighten silhouettes to a gray-blue →
{"shadows": -55, "blacks": -20}; silhouettes should be black. - Tungsten-lit restaurants: night style's warm enhancement can turn everything into a yellow filter →
{"temp": -10, "skin_protect": 0.8, "hsl": {"yellow": {"sat": -22}, "orange": {"sat": -10}}}. - Dusk outdoor often has purple tint:
{"tint": -7}. - iPhone black clothing turning blue/dark red patches: iPhone pushes blacks near 0; when lifting shadows, the old engine multiplied RGB by large factors, amplifying noise into color patches (fixed: chromatic difference max 1.5x); The Film style's blue curve also lifts blacks, turning black clothes into navy; for iPhone photos, override with a neutral blue curve.
If issues are found, create a per-file tweak file (key = filename or stem without extension):
{"DSC07270": {"hsl": {"blue": {"sat": 5, "lum": -10}}},
"DSC07059": {"straighten": -1.5, "crop": [0.0, 0.05, 1.0, 1.0]},
"DSC06913": {"temp": -6, "skin_protect": 0.8, "hsl": {"yellow": {"sat": -15}}},
"DSC07761": {"masks": [{"name": "sky", "mask": {"type": "sky"}, "adjust": {"exposure": -0.3, "dehaze": 15}}]}}
Re-render with pe.py develop ... --per-file fixes.json, then review again (adhering to round limit).
If the entire batch has the same issue (e.g., too warm), apply a global tweak with --adjust '{"temp": -8}'.
Batch Consistency (--consistent, recommended before delivery): auto correction is calculated per image; two adjacent photos from the same scene might have slightly different white balance or shadow correction, making them inconsistent in an album.
pe.py develop "@final.txt" --style STYLE --consistent # --group-gap 600: split new group if time gap > 600s
- Grouping: sort by capture time; split a new group if time gap > 10 minutes, day/night change, or average color/brightness jumps significantly (Lab distance > 18); prints each group's count, time range, and color temperature range.
- Within a group, share median values for
temp,tint,highlights,shadows,whites,blacks,contrast,dehaze. - Exposure remains per-image (camera exposure varies per shot); local subject-lighting masks for backlit people are also kept per image.
.recipe.jsonrecords thegroup. - Real test (14 restaurant photos): highlights varied from -35 to -105 before → unified to -65; shadows from 43 to 66 → 63.
- Per-file tweaks (
--per-file) are stacked on top of synchronized values, so individual adjustments are still possible after synchronization.
4. Full-Resolution Output
pe.py develop "@final.txt" --style STYLE --per-file fixes.json # without --preview = full resolution
pe.py xmp STYLE # export Lightroom preset
pe.py xmp OUT/DSC07761_moody-autumn.recipe.json --name "Hallstatt fog"
24MP takes about 15 seconds per image on an 8GB machine. -j is automatically determined by available memory (8GB = 1); do not manually increase: two simultaneous 24MP jobs will trigger swapping, increasing each image to 5 minutes.
For hundreds of images, use run_in_background. EXIF is preserved; after rotation, Orientation is set to 1.
When delivering, include: output folder, culling results (how many kept out of total), which style was used and why, which images had individual corrections or masks (and what was changed), and a side-by-side before/after overview.
6. Save to iCloud Photos (When Requested by User)
When the user says "save to Photos / iCloud / phone to view," import the results into the macOS Photos app; if iCloud Photos is enabled, it will sync automatically.
pe.py photos OUT_DIR --dry-run # preview: each folder with photos becomes an album (named after the folder), showing photo count
pe.py photos OUT_DIR # import; --album NAME to specify album name
- Only image files are imported;
.recipe.json/.xmpsidecars are not. - Batch size of 25 per batch (
--batch): trying to import 177 at once caused a -609 connection error; batching avoids this; failed batches are retried automatically. - If an album already contains a file with the same filename, it is skipped, so re-running a failed import is safe; at the end, album photo count is verified, and any missing files are listed with a non-zero exit.
- The first run prompts macOS to confirm controlling "Photos"; user must allow. iCloud syncing depends on "Photos > Settings > iCloud"; remind the user at delivery.
- This action writes to the user's photo library (deletion requires manual action), so only do it when the user asks; do not auto-import after editing.
5. Learning a Style from Reference Photos (User Provides a Photographer's Work)
pe.py match TARGET.jpg --ref REF1.jpg REF2.jpg -o my-look.json --strength 0.8
pe.py develop IMGS... --style my-look.json --preview 1200
Transfers color grading, not content: contrast shape around the median axis, black/white points (faded look), color casts in near-neutral pixels (shadows/highlights), and overall saturation. Best results with 2–5 reference photos from the same series. First describe which features of the reference are "transferable" and which are unique to that scene's light/content; do not treat blue skies or orange leaves in the reference as color grading.
Sky (Recover blown-out skies, not replace)
pe.py develop IMG --style STYLE --adjust '{"sky": {"blue": 40}}' # white overcast sky → light blue gradient
| key | effect | default |
|---|---|---|
amount | overall strength (scaled by --strength) | 1 |
recover | darken sky highlights to bring out cloud texture | 40 |
grad | gradient within sky, darker toward top (like graduated ND filter) | 30 |
blue | add a hint of blue to white/gray skies, stronger at top; does not color bright cloud cores; no effect on already-blue skies | 0 (off) |
sat | add saturation when sky is already blue | 15 |
dehaze | dehaze within sky area | 10 |
- Mask: If iPhone has a
skymatte (.mattes/sky.png), use it; otherwise use a heuristic sky mask with texture inspection: True sky (clear, overcast, hazy) has median texture < 0.7e-3; white rocks/walls/snow have ≥ 4.7e-3 → if the entire region exceeds 2e-3, it is not considered sky; do nothing. - Real-world failure record: Without texture inspection, the white rock above a meerkat photo was treated as sky and darkened/tinted blue; per-pixel texture threshold caused an unprocessed bright halo around hair → changed to whole-region judgment.
- Explicitly not implemented: sky replacement, fake clouds, changing light direction. Overcast is overcast;
bluejust makes it look less like white paper; values over 50 start looking fake. - Always crop to 100% and check the sky/hair or sky/tree edge for halos.
Local Masks
The recipe's masks attribute is a list of local adjustments, each = mask + local sliders:
{"masks": [
{"name": "subject lift", "mask": {"type": "subject", "subtract": [{"type": "sky"}]}, "adjust": {"exposure": 0.7, "shadows": 20}},
{"name": "sky", "mask": {"type": "sky"}, "adjust": {"exposure": -0.4, "highlights": -30, "saturation": 10}},
{"name": "grad top", "mask": {"type": "linear", "start": [0.5, 0.0], "end": [0.5, 0.45]}, "adjust": {"exposure": -0.5}},
{"name": "green tame", "mask": {"type": "color", "hue": 100, "range": 40}, "adjust": {"saturation": -25}}
]}
| type | use case |
|---|---|
subject / face | People (head + upper body anchored by detected face / face only); backlit portrait, too-dark face |
sky | Top-connected, bright smooth area; sky too bright, want to darken or add color |
linear | Graduated filter: 100% at start, 0% at end; bright sky + dark foreground |
radial | Ellipse (center, size as width/height ratio, feather); bring light to subject |
luminance | Luminance range (0–1); affect only shadows or highlights |
color | Hue range; affect only a specific color (neon green grass, too-green water) |
boxes | Manually specified face boxes [x,y,w,h] (used when detection fails) |
matte | iPhone semantic masks: {"type": "matte", "name": "skin"} (portrait/skin/hair/teeth/glasses/sky; requires pe.py mattes sidecar, see "Portrait Retouching") |
Common options: invert, amount, feather, intersect: [...], subtract: [...]. Person/sky masks default to edge refinement (guided filter).
Local sliders: temp, tint, exposure, contrast, highlights, shadows, whites, blacks, clarity, texture, dehaze, saturation, vibrance, hsl.
Always verify masks by viewing the overlay:
pe.py masks IMG --auto # automatically suggested masks
pe.py masks IMG --recipe fixes.json # masks from per-file tweak file
pe.py masks IMG --mask subject --mask sky # quick trial
Red = affected area. Check: anything accidentally included (sky mask grabbing white walls, subject mask covering background), any edge discontinuities. After rendering, check edges (hat brim, hair, building outlines) for halos.
Automatic behavior: When analyze detects a "face significantly darker than scene" (backlit, blue-hour selfie), it automatically adds an auto: subject lift mask (excluding sky, only affecting shadows); global exposure is only slightly increased to avoid washing out the sky or night lights.
To disable, add a same-named item in the per-file tweak file: {"masks": [{"name": "auto: subject lift", "mask": {"type": "subject", "amount": 0}}]}.
Common combinations (intent → action):
- Sky bright, foreground dark →
skyor toplinearto reduce exposure/highlights + bottomlinear(start at bottom) to lift shadows. - Subject not prominent enough →
subject+0.3–0.6EV + invertsubjectto reduce saturation or exposure by 10–20%. - Neon green grass but want to affect only grass →
colorhue≈90–110 reduce saturation,intersectwith bottomlinear.
Portrait Retouching (iPhone Photos First)
Principle: Only micro-adjust portraits. In real-world usage, the user sequentially rejected: Film style (face too yellow) → Natural style ("still weird") → pulled face back to original tone ("made me uglier") → skin smoothing + whitening ("just made me pale") → full beauty mode (slim face + big eyes + contour + undereye dark circle removal all on) ("ruined it, ugly"); What was finally accepted: "face stays as close to iPhone original as possible, facial features unchanged, only very slight smoothing / dark circle reduction / teeth whitening / subtle face slimming, while background is made more vibrant." When the user thinks "the original shot of me looks best," any change that makes the face look "processed" is a penalty.
Why iPhone Portraits Get Ruined by Global Color Grading
When iPhones take photos, they already apply local tone adjustments to faces using semantic masks. Applying global highlights/shadows/contrast/warmth again pushes the face brighter or darker, or introduces yellow: Real test showed the same style made one face brightness go from 0.79 → 0.66 (darkened 16%) and another from 0.69 → 0.86 (brightened 25%, with red tint). Skin hue did not shift significantly (both stayed near ~123° on skin color line). So the goal is not to "adjust skin color," but to prevent the face from being dragged away by global adjustments, then apply very light refinements within the skin area.
iPhone File-Embedded Mattes (pe.py mattes)
iPhone HEIC/JPG originals contain ImageIO auxiliary images: portrait (person), skin, hair, teeth, glasses, sky (JPG lacks sky), plus depth map and HDR gain map; resolution ~half of the original, precise enough for hair strands, far better than this skill's "face + ellipse" person mask.
pe.py mattes IMG_7532.HEIC -o DIR # -> DIR/IMG_7532.mattes/{portrait,skin,hair,teeth,glasses,sky}.png + meta.json
- Requires macOS +
swiftc(first run compilesscripts/apple_mattes.swiftto~/.cache/photo-edit/). - Mattes are in sensor orientation;
meta.jsonrecords EXIF orientation, and images are auto-rotated on load; cropping/rotation also apply to the mattes. - Sidecar rule:
developlooks for<image stem>.mattes/(same folder as the image). If the image is renamed, rename the.mattesfolder to the same stem. - Only "Photos" app export of originals (
with using originals) retains mattes; standard JPG export from Photos discards them. Workflow: extract mattes from originals, derive pixel image viasips -s format jpegor standard JPG export from Photos (both geometrically identical), keep the original; to clean up temporary export copies, first confirm it is not the only copy, and handle per user permission. - Mattes can also be used in local masks:
{"type": "matte", "name": "skin"}(becomes an empty mask when no sidecar exists, safe for other cameras).
Portrait Parameters (vivid-iphone style has finalized values built-in)
pe.py develop IMG.jpg --style vivid-iphone --no-auto # always add --no-auto: do not recalculate iPhone exposure
| recipe key | effect | final value |
|---|---|---|
skin_anchor.amount | Within skin mask, pull L/chroma/hue back to original camera skin tone | 0.9 |
skin_anchor.teeth | Teeth whitening + slight brightening (teeth mask) | 0.5 |
skin_anchor.beauty.smooth / texture | Frequency separation smoothing: remove mid-frequency blemishes, retain pores (texture = retention proportion) | 0.35 / 0.8 |
skin_anchor.beauty.even | Even out skin tone (blur color only within skin, don't affect hair) | 0.25 |
skin_anchor.beauty.glow / rosy | Skin brightening (L*) / add pink (a*) | 1 / 0 |
portrait.undereye | Lighten under-eye area that is darker than cheeks, with eyelash line protection | 0.4 |
portrait.slim | Horizontal inward pull from cheeks to jawline (1 = 6% face width); chin point unchanged | 0.2 |
portrait.contour / eyes | Dodge & burn contouring / big eyes | 0 (user rejected) |
portrait uses MediaPipe FaceLandmarker 478 points (scripts/portrait.py, model shared with organize); faces smaller than 6% of the image's long side are not processed.
Failure Records (Do Not Repeat)
- Face slimming that sharpened the chin: Points near the chin also moved inward, compressing the sides into a sharp V-face; the collar below the chin was also distorted → now only push from cheeks to jawline, only horizontally, within a radius of 0.13×face width.
slim> 0.4 already looks processed. - Full beauty mode on (smooth 0.7 + glow + rosy + contour + big eyes): Face became white, flat, like an app filter → user directly said "ugly." Always start from the final values above; ask before increasing any strength.
- Film style's blue curve (black point 0→18) turned black clothes on iPhone photos into navy → avoid styles that lift blue channel blacks on iPhone photos, or override with a neutral blue curve.
- Contrast: When the user says "looks weird," first line up the original next to the edit and ask "which column looks best?" instead of guessing the next style. If they choose "original," that means return to the iPhone look and then micro-adjust.
Verification
- Each time, crop a 100% facial comparison "original | edited" side-by-side: check hairline, hat brim, collar (face slim deformation), eye area (undereye reduction must not catch eyelashes), teeth.
- Confirm no deformation: Canny edge overlap ratio between edited and original should be ≥ 0.9; sometimes "looks slimmer" is just from stronger background contrast.
- Delivery