Skip to content

Pen pressure for the Brush's size and opacity - #194

Open
rezaularif wants to merge 1 commit into
robbietilton:mainfrom
rezaularif:pen-pressure
Open

rezaularif wants to merge 1 commit into
robbietilton:mainfrom
rezaularif:pen-pressure

Conversation

@rezaularif

@rezaularif rezaularif commented Sep 30, 2026 •

Copy link
Copy Markdown

Adds pen pressure for the Brush's size and opacity, on a graphics tablet.

What's added

  • Two buttons beside the Brush's Opacity, as in Photoshop: pressure sets the size, or pressure sets the opacity. Both are off by default.
  • Size: a light touch paints a thinner line, down to one pixel.
  • Opacity: a light touch paints fainter, up to the brush's Opacity, and a stroke never gets more opaque than its firmest press.
  • Pressure is carried to both the GPU brush and the software fallback, and eases smoothly along the stroke.
  • Only tablet events carry pressure. A mouse, or a Force Touch trackpad, paints at full pressure, so those strokes are unchanged.

How to use

  • Pick the Brush (B), in Paint or Erase, and turn on either or both pressure buttons next to Opacity.
  • Paint with a tablet pen. Press harder for a wider or stronger line, lighter for a thinner or fainter one.

Tests

  • PenPressureTests, using simulated tablet events. The full suite passes, and the project format is unchanged.
  • It hasn't been tried on a physical tablet yet.
  • Frame times with a pen match a mouse on a 4000 × 4000 photo.

If Dodge and Burn (#193) is merged first, BrushSettings and the README have a small conflict. Keep both sides.

Two buttons beside the Brush's Opacity, as Photoshop has: with one on, a
tablet pen's pressure sets the size of each part of the stroke, and with
the other, how strongly it lays down, up to the brush's Opacity; a stroke
never gets more opaque than its firmest press. They work in Paint and
Erase. Pressure is carried to both the GPU coverage and the software
dabs, and between samples it eases along the stroke. Only tablet events
carry it: a mouse or a Force Touch trackpad paints at full pressure, so
their strokes are unchanged, and the release, which reports none, keeps
the last pressure rather than ending in a full-size blot.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant