Add Image.BackgroundColor and use it in rotate/affine/warp_perspective#207
Open
hlindset wants to merge 1 commit into
Open
Add Image.BackgroundColor and use it in rotate/affine/warp_perspective#207hlindset wants to merge 1 commit into
Image.BackgroundColor and use it in rotate/affine/warp_perspective#207hlindset wants to merge 1 commit into
Conversation
2f928b7 to
60afdf1
Compare
60afdf1 to
6d87ae4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
:average|Image.Pixel.t()into a concrete color or%Image.Error{}for use in validators, and makes use of it inrotate,affineandwarp_perspective.:averagecase appends an opaque alpha band, if the image has an alpha band, to matchto_pixel. Callers needing to drop alpha can then do so unconditionally.:averageerroring onrotate/affine-based ops - a real oversight in my first implementation of:averageforaffine/rotate, where I patterned it offwarp_perspectivewhich flattens it input first. Regression tests added.Image.embed/4couldn't make use of this because it has split:background_color/:background_transparencyoptions. Maybe a candidate for a refactor, folding the alpha handling into a single:backgroundoption? Discovered a latent bug there, however, and will follow up with a PR for that very soon.Open question: Is
lib/background_color.ex/Image.BackgroundColorthe right place for this module? I can move it elsewhere if you'd prefer.Note that depending on which of this and #206 lands first (if any), the second should be updated to make use of it (or in a short follow-up PR).