Skip to content

ImageDataUtil: Apply the strength in gaussianBlur - #2119

Open
Tutez64 wants to merge 2 commits into
openfl:developfrom
Tutez64:bugfix/gaussian-blur-strength
Open

Tutez64 wants to merge 2 commits into
openfl:developfrom
Tutez64:bugfix/gaussian-blur-strength

Conversation

@Tutez64

@Tutez64 Tutez64 commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

ImageDataUtil.gaussianBlur() takes a strength but ignored it. OpenFL's
software GlowFilter and DropShadowFilter pass theirs to it, so on the Cairo
renderer and in BitmapData.draw(), a glow or a shadow came out as the same
faint halo whatever its strength. Flash multiplies the blurred alpha by the
strength, which is how a glow of strength 4 gives text a solid outline.

The blurred alpha is now multiplied by the strength and clamped to opaque, over
the pixels that the blur wrote. A strength of 1 leaves the result unchanged.

Test: graphics.ImageDataUtilTest blurs a dot with strengths 1, 4 and 255.
Without the fix the alpha stays the same for all three (expected 40 but it is 10); with it, the test passes on neko. In a Linux cpp repro, a text field
with a GlowFilter drew the same pixels at strength 1, 4 and 50 before the
fix. After it, strengths 1 and 4 give different pixels.

Tutez64 and others added 2 commits November 8, 2026 02:26
gaussianBlur took a strength but ignored it, so the software GlowFilter and
DropShadowFilter of OpenFL drew a faint halo for any strength. As in Flash, the
blurred alpha is now multiplied by the strength, up to opaque.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On Flash, the pixels of an Image are in a flash.display.BitmapData, not in
the data that gaussianBlur reads, so the test failed on AIR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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