-
-
Notifications
You must be signed in to change notification settings - Fork 848
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add PremultiplyAlpha to ResizeOptions #1504
Add PremultiplyAlpha to ResizeOptions #1504
Conversation
PixelConversionModifiers.Premultiply.ApplyCompanding(compand); | ||
PixelConversionModifiers conversionModifiers = premultiplyAlpha ? | ||
PixelConversionModifiers.Premultiply.ApplyCompanding(compand) : | ||
PixelConversionModifiers.None.ApplyCompanding(compand); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applying compand to the None modifier. Not sure if correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's OK, although not super happy about how it looks now. Would replace the ApplyCompanding
helper with something like:
public static PixelConversionModifiers GetModifiers(bool compand, bool premultiplyAlpha);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I split it out into a separate private function. I hope that's what you meant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok with the private function for now. This is the only place that uses it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a minor suggestion.
Opened SixLabors/Imagesharp.Tests.Images#14 with your images. As soon as it gets merged, we need to push an update of the submodule reference for tests/Images/External
.
I leave the approval & merge of the submodule PR tor @JimBobSquarePants since we need his final blessing anyways.
Thanks for taking the time!
PixelConversionModifiers.Premultiply.ApplyCompanding(compand); | ||
PixelConversionModifiers conversionModifiers = premultiplyAlpha ? | ||
PixelConversionModifiers.Premultiply.ApplyCompanding(compand) : | ||
PixelConversionModifiers.None.ApplyCompanding(compand); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's OK, although not super happy about how it looks now. Would replace the ApplyCompanding
helper with something like:
public static PixelConversionModifiers GetModifiers(bool compand, bool premultiplyAlpha);
Reference image merged. git submodule foreach git pull origin master Will update all the modules. |
Codecov Report
@@ Coverage Diff @@
## master #1504 +/- ##
=======================================
Coverage 83.52% 83.52%
=======================================
Files 741 741
Lines 32664 32672 +8
Branches 3661 3662 +1
=======================================
+ Hits 27281 27289 +8
Misses 4669 4669
Partials 714 714
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Thanks for this @ptasev ! I'll get it merged for you now. It'll be available to you in our MyGet feed once built. |
Add PremultiplyAlpha to ResizeOptions
Prerequisites
Description
Added PremultiplyAlpha to the ResizeOptions. This option was always on by default, but now the user has the ability to turn it off through the options.
Fixes #1498