Skip to content

Fix GaussianBlur(radius: 0) blurring instead of being an identity transform - #893

Merged
kean merged 1 commit into
mainfrom
fix/gaussian-blur-zero-radius
Aug 15, 2026
Merged

kean merged 1 commit into
mainfrom
fix/gaussian-blur-zero-radius

Conversation

@kean

@kean kean commented Aug 15, 2026

Copy link
Copy Markdown
Owner

blurred(radius:) clamped the radius with max(Double(radius), 2.0), so GaussianBlur(radius: 0) produced a kernel of 5 across three box passes — a clearly visible blur — instead of returning the image unchanged. Negative radii behaved the same way.

The clamp also made every radius in 0...2 render identically while identifier and Hashable treated them as distinct processors, so they populated the caches with duplicate entries holding the same bytes.

  • radius is clamped to 0 at the low end, so GaussianBlur(radius: -8) and GaussianBlur(radius: 0) are the same processor.
  • A radius of 0 returns the image unchanged.
  • The kernel is now derived from the radius as given, so 1, 2, and 3 produce different output, matching their different identifiers.

`blurred(radius:)` clamped the radius with `max(Double(radius), 2.0)`, so
a radius of `0` - or any negative value - produced a kernel of 5 across
three box passes, a clearly visible blur.

The clamp also made every radius in `0...2` render identically while
`identifier` and `Hashable` treated them as distinct processors, which
populated the caches with duplicate entries holding the same bytes.

The radius is now clamped to `0` at the low end, a radius of `0` returns
the image unchanged, and the kernel is derived from the radius as given.
@kean kean modified the milestones: 14.0, 13.2.0 Aug 15, 2026
@kean
kean merged commit 928f726 into main Aug 15, 2026
5 checks passed
@kean
kean deleted the fix/gaussian-blur-zero-radius branch August 16, 2026 20:20
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