Skip to content

Add blur tool to annotation editor#20

Merged
morvader merged 2 commits intomasterfrom
claude/add-image-blur-feature-IN04B
Mar 10, 2026
Merged

Add blur tool to annotation editor#20
morvader merged 2 commits intomasterfrom
claude/add-image-blur-feature-IN04B

Conversation

@morvader
Copy link
Owner

Summary

This PR adds a new blur annotation tool to the annotation editor, allowing users to obscure sensitive regions of images by applying a blur effect to selected rectangular areas.

Key Changes

  • New blur tool implementation: Added drawBlur() function that uses canvas clipping and CSS filters to apply a configurable blur effect to selected regions
  • Blur radius constant: Introduced BLUR_RADIUS = 12px to control the strength of the blur effect
  • Tool integration:
    • Added blur tool to the drawing pipeline (mouse move and mouse up handlers)
    • Integrated blur annotations into the redraw/replay system
    • Added blur tool button to the UI with custom cursor styling
  • Keyboard shortcut: Added 'B' key binding to activate the blur tool
  • UI updates:
    • New blur tool button with custom SVG icon
    • Active state styling with indigo color scheme (#4F46E5)
    • Custom cursor with dashed circle indicator
    • Updated keyboard shortcuts help text

Implementation Details

  • The blur effect is implemented using canvas ctx.clip() to confine the blur to the selected rectangle, preventing it from bleeding outside the bounds
  • The blur is applied by redrawing the base image with ctx.filter = 'blur()' within the clipped region
  • Blur annotations are stored with type, position (x, y), and dimensions (width, height)
  • Minimum size validation (2px) prevents accidental blur creation from small mouse movements
  • Supports negative width/height values (when dragging right-to-left or bottom-to-top) by normalizing rectangle coordinates

https://claude.ai/code/session_01TbfSaMsdyScyRiY8m1xYrd

claude and others added 2 commits March 10, 2026 04:18
Users can now select the Blur tool (button or keyboard shortcut B) to
drag a rectangle over sensitive areas of a cropped screenshot before
saving. The selected region is blurred using the canvas clip+filter
technique, and blur regions support undo like other annotation types.

https://claude.ai/code/session_01TbfSaMsdyScyRiY8m1xYrd
@morvader morvader merged commit 991abd8 into master Mar 10, 2026
4 checks passed
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.

3 participants