diff --git a/src/ImageSharp/Processing/Processors/Effects/OilPaintingProcessor{TPixel}.cs b/src/ImageSharp/Processing/Processors/Effects/OilPaintingProcessor{TPixel}.cs index 1b350ea8b0..d8e2eec166 100644 --- a/src/ImageSharp/Processing/Processors/Effects/OilPaintingProcessor{TPixel}.cs +++ b/src/ImageSharp/Processing/Processors/Effects/OilPaintingProcessor{TPixel}.cs @@ -68,6 +68,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Effects { // Rent the shared buffer only once per parallel item. using IMemoryOwner bins = configuration.MemoryAllocator.Allocate(levels * 4); + ref float binsRef = ref bins.GetReference(); ref int intensityBinRef = ref Unsafe.As(ref binsRef); ref float redBinRef = ref Unsafe.Add(ref binsRef, levels); @@ -128,7 +129,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Effects float alpha = sourceRow[x].ToVector4().W; ref TPixel pixel = ref targetRow[x]; - pixel.FromVector4(new Vector4(red, green, blue, sourceRow[x].ToVector4().W)); + pixel.FromVector4(new Vector4(red, green, blue, alpha)); } } }