Browse Source

Merge pull request #1042 from jongleur1983/PorterDuffImprovement

small improvements on the PorterDuff functions
af/merge-core
James Jackson-South 6 years ago
committed by GitHub
parent
commit
e307fcfc1e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/ImageSharp/PixelFormats/PixelBlenders/PorterDuffFunctions.cs

4
src/ImageSharp/PixelFormats/PixelBlenders/PorterDuffFunctions.cs

@ -164,7 +164,7 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
float srcW = source.W - blendW;
// calculate final alpha
float alpha = dstW + srcW + blendW;
float alpha = dstW + source.W;
// calculate final color
Vector4 color = (destination * dstW) + (source * srcW) + (blend * blendW);
@ -191,7 +191,7 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders
float dstW = destination.W - blendW;
// calculate final alpha
float alpha = dstW + blendW;
float alpha = destination.W;
// calculate final color
Vector4 color = (destination * dstW) + (blend * blendW);

Loading…
Cancel
Save