Skip to content

[Feature] Add Dodge and Burn Brush Modes #169

Description

@Cengokill

Problem

The brush can paint the foreground color or erase pixels, but it cannot lighten or darken a local area of a photo. A face that needs lifting, or a shadow that needs more weight, currently means an extra layer, a mask, and a global adjustment.

Proposal

Add two modes to the existing brush, next to Paint and Erase:

  • Dodge lightens the pixels under the stroke.
  • Burn darkens them.

Each mode offers a tonal range — Shadows, Midtones, or Highlights — and an Exposure control from 0 to 100%. At 0%, pixels do not change.

These modes edit raster pixels directly. They are not a layer blend mode and not a brush blend mode. The Layers panel stays the only place a blend mode is chosen.

Behavior

Dodge and Burn share the current brush stroke: the same tip, tiles, and commit as Paint and Erase.

They keep:

  • size and hardness;
  • stroke opacity, which still caps the whole stroke so overlapping dabs do not stack past it;
  • smoothing;
  • the active selection;
  • a Shift-click straight line.

The foreground color is not used, and its swatch is hidden in these modes. Range and Exposure appear only then. Defaults are Midtones and 50%. There is no stylus-pressure control on the brush today, so this feature does not add one.

A stroke is refused in the same cases as Paint: several layers selected, a hidden layer, a folder, an adjustment layer, or an empty selection. It is also refused when the layer mask is the paint target, and when the layer has no image. A layer mask that is only displayed does not limit which pixels are rewritten. Fully transparent pixels stay as they are, and alpha is left unchanged.

On a text or shape layer, the stroke follows the brush’s existing destructive commit: pixels are replaced, editable text or shape metadata is dropped, and layer effects remain.

Coverage builds up as it does now, then the effect is applied once to the original pixels. Dabs inside one stroke do not compound. Releasing the pointer records a single history entry, named Dodge or Burn. Another stroke is a separate entry. Undo and Redo restore the exact pixels. A stroke that changes nothing, including 0% exposure, adds no history entry.

Pixels

The work stays in the brush’s sRGB pixel buffer, on the layer’s own pixel grid. Size remains in document pixels, independent of zoom.

Dodge moves covered color toward white. Burn moves it toward black. Strength is exposure, times a smooth weight for the chosen range, times the same final coverage Paint would use. Shadows favor dark pixels, Highlights favor light pixels, and Midtones favor the middle. The weight falls off gradually, so the range does not leave a hard edge.

File and export

The result is ordinary layer pixels. The .comp file gains no fields, and its version does not change. Preview, save, reopen, and export all show those pixels.

Acceptance

  • Dodge lightens the affected pixels. Burn darkens them.
  • The range limits the effect to shadows, midtones, or highlights, with a smooth falloff.
  • Exposure scales the effect. At 0%, pixels are unchanged and history does not grow.
  • Size, hardness, opacity, smoothing, selection, and Shift-click match Paint and Erase.
  • Painting a mask is refused. A displayed layer mask does not clip the stroke.
  • Alpha is unchanged. Transparent pixels are unchanged.
  • One continuous stroke is one history step. Separate strokes undo on their own.
  • Text and shape metadata are dropped. Layer effects remain.
  • Save, reopen, and export keep the result.
  • Paint, Erase, Spot Healing, Clone Stamp, Liquify, Blur, and Smudge do not regress.
  • No brush blend mode is added.

Tests

Cover Dodge and Burn on each range, low and full exposure, 0% exposure, a partial selection, a refused mask target, opacity, undo and redo after one stroke and after several, a stroke that changes nothing, and save, reopen, and export. Include a regression pass for the other brush tools.

Out of scope

Brush or layer blend modes, a new retouching tool or layer, global lighting correction, stylus pressure, saving brush settings across launches, and a redesign of the brush or the renderer.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions