Skip to content

Import brush tips and packs with pressure opacity and pen tilt - #157

Merged
IAmJSD merged 2 commits into
mainfrom
feat/richer-brushes
Sep 20, 2026
Merged

IAmJSD merged 2 commits into
mainfrom
feat/richer-brushes

Conversation

@IAmJSD

@IAmJSD IAmJSD commented Sep 20, 2026 •

Copy link
Copy Markdown
Member

Brush presets can now embed imported bitmap masks and be shared as portable packs. The Preset panel imports PNG/JPEG/WebP/TIFF tips, GIMP GBR brushes, sampled Photoshop ABR packs, and .schist-brushes JSON packs, and exports all saved recipes. Imports preserve existing presets, rename duplicate names, and apply only after the updated library is saved.

  • Paint, Pencil and Eraser stamp rectangular masks at their original aspect ratio, with manual angle and independent pressure-controlled opacity. Per-stroke opacity limits, selection clipping, cancel and undo/redo remain intact.
  • Browser pen tilt comes from actual DOM PointerEvent tiltX/tiltY, is interpolated with the stroke, and rotates the tip. Native GPUI currently supplies pressure without tilt, so the native Pen tilt control is disabled and marked Not available; manual rotation works on every platform. No physical tablet smoke test has been performed.
  • Imported masks and settings persist in presets. Validation bounds each tip to 1024² pixels, the library to 128 presets / 4 MiB of mask data, and serialized/imported files to 20 MiB. Browser storage quota failures keep the existing library and active recipe.
  • ABR support covers 8-bit sampled masks in versions 1/2 and 6/10 (subversions 1/2), raw or PackBits. Modern ABR dynamics descriptors are not interpreted: sample names are numbered and spacing defaults to 25%. Unsupported computed brushes, depths and versions are rejected without partial imports. Public GIMP reader / GBR specification / W3C references and the pack schema are documented in docs/brushes.md; no Adobe SDK headers were read or Photoshop plugin module changed.
  • The Pen tilt label is translated for all 150 shipped locales; existing translations label the remaining controls.

Validation (separate native and wasm target directories, excluding other worktrees’ workspace artifacts):

  • make test-richer-brushes: 66 passing tests across import/persistence, plugin API, paint engine, brush workflows and retouch regressions. Includes ABR raw/PackBits versions and exhaustive truncation, malformed/bounded imports, portable pack persistence, duplicate naming, pressure coverage/undo, rectangular masks, tilt and canvas rotation, event batching, selection, pencil and eraser.
  • make check-brush-workflows: native editor and all targets compile.
  • make check-richer-brushes-web: wasm editor and actual DOM pen input path compile.
  • make check-i18n: Rust catalog tests, all 150 shipped catalogs/font coverage, locale aliases and web loader tests pass.
  • make lint-richer-brushes: strict Clippy (-D warnings) passes for every changed crate and all targets.
  • Make-driven cargo fmt --all --check and git diff --check: clean.

Checks used CARGO_BUILD_JOBS=2, dev/test debug information disabled and incremental compilation disabled. Only the existing proc-macro-error2 future-compatibility notice remains. ABR compatibility is verified with synthetic fixtures, not every third-party exporter; physical tablet smoke testing remains outstanding.

@IAmJSD
IAmJSD merged commit f1ad562 into main Sep 20, 2026
5 checks passed
@IAmJSD
IAmJSD deleted the feat/richer-brushes branch September 20, 2026 12:26
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