rnote icon indicating copy to clipboard operation
rnote copied to clipboard

Feature: Highlighter that works on PDFs

Open Keschler opened this issue 3 weeks ago • 3 comments

Creates a new type of brush: Highlighter

Addresses: #449

I added a new Highlighter brush designed for highlighting text on PDFs or notes. It features a pipeline to handle transparency correctly and includes an auto-straightening helper for cleaner lines.

Technical Implementation:

  • New Layering: Added a PDFHighlighter layer to StrokeLayer
  • Auto-Straighten: Added logic to detect roughly straight strokes and replace them with a single straight line automatically.

To fix Alpha-Accumulation

  1. Stroke is first drawn at 100% opacity
  2. Once the stroke is rasterized into an image, the alpha is applied

Demo: Highlighter rnote

Disclaimer: This implementation was primarily generated with the assistance of GitHub Copilot.

Keschler avatar Nov 28 '25 10:11 Keschler

I just realized a similar highlighter exists https://github.com/flxzt/rnote/pull/1210, but my implementation still seems useful, because it is easier to find and usable as a pen instead of a shape.

An useful addition could be to modify the transparency/opacity

Keschler avatar Dec 03 '25 08:12 Keschler

I agree. Although the shape is nice, the pen is what I'm most likely to use. Is the Auto-Straighten feature for all pens, or just for the highlighter?

NXTler avatar Dec 09 '25 12:12 NXTler

Just for the highlighter right now

Keschler avatar Dec 09 '25 12:12 Keschler