Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/ImageSharp.Drawing/Processing/BackdropLayerEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ private static Action<IImageProcessingContext> 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<Rgba32>().ToScaledVector4();
Vector4 vector = color.ToScaledVector4(PixelAlphaRepresentation.Unassociated);
float keep = 1F - vector.W;
ColorMatrix tint = default;
tint.M11 = keep;
Expand Down Expand Up @@ -186,7 +186,7 @@ private static Action<IImageProcessingContext> 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<Rgba32>().ToScaledVector4();
Vector4 vector = color.ToScaledVector4(PixelAlphaRepresentation.Unassociated);
ColorMatrix tint = default;
tint.M44 = vector.W;
tint.M51 = vector.X;
Expand Down
6 changes: 3 additions & 3 deletions src/ImageSharp.Drawing/Processing/LayerEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ private static Action<IImageProcessingContext> 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<Rgba32>().ToScaledVector4();
Vector4 vector = color.ToScaledVector4(PixelAlphaRepresentation.Unassociated);
ColorMatrix tint = default;
tint.M44 = vector.W;
tint.M51 = vector.X;
Expand Down Expand Up @@ -244,7 +244,7 @@ private static Action<IImageProcessingContext> 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<Rgba32>().ToScaledVector4();
Vector4 vector = color.ToScaledVector4(PixelAlphaRepresentation.Unassociated);
ColorMatrix tint = default;
tint.M44 = vector.W;
tint.M51 = vector.X;
Expand Down Expand Up @@ -326,7 +326,7 @@ private static Action<IImageProcessingContext> 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<Rgba32>().ToScaledVector4();
Vector4 vector = color.ToScaledVector4(PixelAlphaRepresentation.Unassociated);
ColorMatrix invertedTint = default;
invertedTint.M44 = -vector.W;
invertedTint.M54 = vector.W;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading