# Vibe Coding Photoshot Retouch, Part 1 — From a Photo to Editable Layers

> Source: <https://dev.to/_f2ad1d4a811a87449655b/vibe-coding-photoshot-retouch-part-1-from-a-photo-to-editable-layers-1bd2>
> Published: 2026-11-24 10:09:46+00:00

**Key takeaway:** Returning each retouch correction as its own masked layer (pixels, mask and position) lets users fade individual fixes in Photoshop, and a three-pixel test confirmed mask blending of 0%, 50% and 100% yields values of 80, 100 and 120.

Say a retouch removes a blemish and softens the dark area under an eye. The blemish looks better, but you want some of the original shadow back. If each correction comes back on its own layer, you can fade just the shadow correction. A layer is like a transparent sheet over the photo, and a mask controls how much of that sheet shows in each spot.

## 
  
  
  What we’re building in 24 parts

Photoshot Retouch is a photo-retouching tool for a web editor and Adobe Photoshop. In this **vibe coding** series I describe the behavior I want, build it with AI assistance, and check that behavior on a small example before moving on.

- 
**Parts 1–4** start with a tiny image and build the first masked PNG, face analysis, and layer output.
- 
**Parts 5–17** build 14 tools for skin, eyes, teeth, backgrounds, clothing, and details such as glare on glasses.
- 
**Parts 18–21** connect the engine to the web editor and Photoshop, then add Undo, batch processing, and Photoshop document (PSD) export.
- 
**Parts 22–24** build a Windows installer, check retouch quality, and repeat the workflow on a clean PC.

## 
  
  
  What checklist items 52–57 mean

I reviewed the public examples for Retouch4me, an existing Photoshop retouching panel, and turned the behaviors I wanted to investigate into a numbered checklist. Each entry pairs a behavior with a Photoshot implementation or a check. Part 1 covers the six entries about running the tools and handing their results back to the editor. [Retouch4me layered-output examples](https://retouch4.me/docs/cloud_retouching_api/en/#layer-previews)

**Input → processing → output**

Photo and tool settings → face and skin analysis → corrected pixels, mask, and position → editable layers or a merged correction.

## 
  
  
  Which pieces came from GitHub?

- 
**52 · Run tools in order.** MediaPipe supplies face landmarks and region masks. Photoshot shares that analysis across tools and runs them in the requested order.[MediaPipe](https://github.com/google-ai-edge/mediapipe)
- 
**53 · Return one layer per tool.** OpenCV finds the part of the mask where a correction applies and the rectangle around it. Photoshot returns that rectangle’s pixels, mask, and position so Photoshop can place the layer.[OpenCV](https://github.com/opencv/opencv)
- 
**54 · Group layers.** Photoshot assigns categories such as Skin and Details and calls Photoshop’s layer-group API. Adobe’s public UXP samples were a reference for connecting the panel.[Adobe UXP samples](https://github.com/AdobeDocs/uxp-photoshop-plugin-samples)
- 
**55 · Return a merged correction.** NumPy lets the engine compare the accumulated result with the source pixel by pixel and package the changed area as one correction layer.[NumPy](https://github.com/numpy/numpy)
- 
**56 · Blend the correction.** The engine uses NumPy to combine source and corrected colors according to the mask. The Photoshop layer uses Normal mode.[NumPy](https://github.com/numpy/numpy)
- 
**57 · Adjust strength and opacity.** Photoshot’s tool strength changes what the tool computes. Photoshop’s built-in layer opacity fades that layer after the run.[Adobe Layer API](https://developer.adobe.com/photoshop/uxp/ps_reference/classes/layer/)

I checked the engine with three pixels. Each starts at 80 and has a proposed correction of 120. With mask coverage of 0%, 50%, and 100%, the visible values came back as **80, 100, and 120** in both the separate-layer and merged outputs.

The [full article on SLOHERO](https://slohero.com/blog/photoshot-retouch-development-01) includes the architecture diagram, code excerpts, and the three-pixel walkthrough.

In Part 2, we’ll start from an empty folder and save a PNG with one area brightened by a mask.
