Add TrimBackground as an argument + go.mod + fix pointer bug [Proposal] #382
+134
−20
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.
Use case: when using Vips_find_trim (for the
Trim: true
the last argument is the "background" and any alpha channel is looked at as the background argument. In this case you may want to keep the alpha channel but pass it an argument that's a bright easily edge-able color (similar to a green screen). When using the regularBackground
argument in this case it will flatten alpha channels to that background color when we want to keep alpha channel transparency. [Added in a way that maintains backwards compatibility with the existing API]adds unit testing for this new options
adds a trim padding option to allow
this also removes a unset pointer that was causing crashes when running trim operations at 30 RPS
add go.mod for modern module support
I can and would break these out into different branches and you guys can pick which features if any you want out of them but I'd highly recommend merging 1,2 and 4. 3 is more of a nice to have feature for our use case.