Open AcruxDevelopment opened 3 weeks ago
The shader do not touch the alpha value of the pixels.
Maybe the control has a background color which is modified, too?
Nop, i created a brand new WPF.NET C# project for testing, just added an image, added the effect to it and the issue persists:
As shown in the image, i selected a random png asset i had, placed it in a gray background colored window (it can be any color, it was just to differenciate between the place where the buggy white tint takes place and the rest of the window), attached the effect, and that's the result.
I'm sure your image doesn't contains full transparent pixels.
If your image contains partial transparent pixels, it will combine the color from the background. That's correct.
Here is an example. The blue rectangle is a full transparent area. (This grid has the blue background color.)
brightness = -1
brightness = 1
Please use the example demo from this respository and test again.
Problem
I intalled this via
dotnet add package WPF.ImageEffects --version 1.5.0
and I found that when I apply theBrightness
property to a positive number, the transparent parts of the image get tinted white. However, this does not happen when I apply the property to a negative value or zero.Notes
I have a single instance of the
BrightnessContrastEffect
class, where that instance is applied to aGrid
full ofImage
s.The instance is created programmatically:
And the instance is attached this way:
SpriteGrid.Effect = BrightnessContrastEffect;
I am not sure if the problem is related to the fact that the shader also picks up other elements that are not part of the grid itself, but are rendered behind it, thus applying the shader to everything within the grid's boundaries.
Also, having to apply the effects to the images individually isnt a solution for me because it would cause the effect to "accumulate" in semi-transparent images
Thanks for your help.