diff --git a/src/ImageSharp.Drawing/Processing/BackdropLayerEffect.cs b/src/ImageSharp.Drawing/Processing/BackdropLayerEffect.cs index ae258ff9..2563aad9 100644 --- a/src/ImageSharp.Drawing/Processing/BackdropLayerEffect.cs +++ b/src/ImageSharp.Drawing/Processing/BackdropLayerEffect.cs @@ -109,7 +109,7 @@ private static Action CreateOperation(float sigma, Colo // Blending a constant colour over the backdrop is linear, so it is expressed as a colour // matrix: the backdrop's channels scale by one minus the tint's alpha and the constant row // carries the pre-scaled tint. The backdrop's own alpha is preserved. - Vector4 vector = color.ToPixel().ToScaledVector4(); + Vector4 vector = color.ToScaledVector4(PixelAlphaRepresentation.Unassociated); float keep = 1F - vector.W; ColorMatrix tint = default; tint.M11 = keep; @@ -186,7 +186,7 @@ private static Action CreateOperation(float sigma, Colo // The tint replaces the backdrop's colour with the constant shadow colour and scales its // alpha; the DestOver write-back slots the blurred silhouette beneath the untouched // backdrop at the offset. - Vector4 vector = color.ToPixel().ToScaledVector4(); + Vector4 vector = color.ToScaledVector4(PixelAlphaRepresentation.Unassociated); ColorMatrix tint = default; tint.M44 = vector.W; tint.M51 = vector.X; diff --git a/src/ImageSharp.Drawing/Processing/LayerEffect.cs b/src/ImageSharp.Drawing/Processing/LayerEffect.cs index 2c54fd4e..c1b90dca 100644 --- a/src/ImageSharp.Drawing/Processing/LayerEffect.cs +++ b/src/ImageSharp.Drawing/Processing/LayerEffect.cs @@ -172,7 +172,7 @@ private static Action CreateOperation(float sigma, Colo // alpha. The colour filter operates on straight alpha, so with the RGB rows zeroed the // constant row sets the colour outright; because the colour is then constant across the // snapshot, the blur only spreads alpha and cannot bleed foreign colours into the shadow. - Vector4 vector = color.ToPixel().ToScaledVector4(); + Vector4 vector = color.ToScaledVector4(PixelAlphaRepresentation.Unassociated); ColorMatrix tint = default; tint.M44 = vector.W; tint.M51 = vector.X; @@ -244,7 +244,7 @@ private static Action CreateOperation(float sigma, Colo // alpha. The colour filter operates on straight alpha, so with the RGB rows zeroed the // constant row sets the colour outright; because the colour is then constant across the // snapshot, the blur only spreads alpha and cannot bleed foreign colours into the glow. - Vector4 vector = color.ToPixel().ToScaledVector4(); + Vector4 vector = color.ToScaledVector4(PixelAlphaRepresentation.Unassociated); ColorMatrix tint = default; tint.M44 = vector.W; tint.M51 = vector.X; @@ -326,7 +326,7 @@ private static Action CreateOperation(float sigma, Colo // with the constant RGB rows carrying the shadow colour, the blur feathers the boundary, // and the SrcAtop write-back clips the result onto the content so only the parts that // reach inside its edges remain. - Vector4 vector = color.ToPixel().ToScaledVector4(); + Vector4 vector = color.ToScaledVector4(PixelAlphaRepresentation.Unassociated); ColorMatrix invertedTint = default; invertedTint.M44 = -vector.W; invertedTint.M54 = vector.W; diff --git a/tests/Images/ReferenceOutput/Drawing/WebGPUDrawingBackendTests/DrawText_WithBackdropFilterLayerEffects_MatchesDefaultOutput_acrylic_Default.png b/tests/Images/ReferenceOutput/Drawing/WebGPUDrawingBackendTests/DrawText_WithBackdropFilterLayerEffects_MatchesDefaultOutput_acrylic_Default.png index d151a9b5..b9207cfc 100644 --- a/tests/Images/ReferenceOutput/Drawing/WebGPUDrawingBackendTests/DrawText_WithBackdropFilterLayerEffects_MatchesDefaultOutput_acrylic_Default.png +++ b/tests/Images/ReferenceOutput/Drawing/WebGPUDrawingBackendTests/DrawText_WithBackdropFilterLayerEffects_MatchesDefaultOutput_acrylic_Default.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b500298b467004907a1ad28829754f07becdae12cd3efbf5329b78bebbc527a6 -size 66512 +oid sha256:baccc50c278877e04f0d84785d91cebf1ef14a5c60013d263aa2f86d658f0594 +size 80785 diff --git a/tests/Images/ReferenceOutput/Drawing/WebGPUDrawingBackendTests/DrawText_WithBackdropFilterLayerEffects_MatchesDefaultOutput_acrylic_WebGPU_NativeSurface.png b/tests/Images/ReferenceOutput/Drawing/WebGPUDrawingBackendTests/DrawText_WithBackdropFilterLayerEffects_MatchesDefaultOutput_acrylic_WebGPU_NativeSurface.png index 4d3bab32..df5c05c3 100644 --- a/tests/Images/ReferenceOutput/Drawing/WebGPUDrawingBackendTests/DrawText_WithBackdropFilterLayerEffects_MatchesDefaultOutput_acrylic_WebGPU_NativeSurface.png +++ b/tests/Images/ReferenceOutput/Drawing/WebGPUDrawingBackendTests/DrawText_WithBackdropFilterLayerEffects_MatchesDefaultOutput_acrylic_WebGPU_NativeSurface.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5d846917eb6c45c177dc13bc37f5744db329f3041941a37f0ba1e9a1141781ac -size 65215 +oid sha256:8ec10bd4e7cb6d7f51d5549eaf1c771d1dfd5195bfc3ff9beb11f3e93d61fd7c +size 79300