Color artifacts when mask reaches boundaries
Thanks for sharing this repository!
The blended result often has some color artifacts when the mask reaches the image's boundary. For exmaple - (src,dst, and mask resized for readability. Everything at 1024x1024 originally).
| Source | Target | Mask |
|---|---|---|
Result:
The result image has faded yellow and blue "color artifacts" near the right and left image boundaries. At least for the right side, I'm assuming it might be caused by lack of accurate boundary conditions. But on the other hand, some cases where the mask reaches the boundary are fine...
Do you have a suggestion for solving this issue? Thanks!
Hmm not sure exactly, which implementation are you using (Green's function or DST)? From the result I also assume you're using mixed_gradients, but a code snipped would help to clarify what you're running here.
I found some color artifacts that I solved clampling the blended result in the range 0 to 1
Ah yes if you are using images with a specific value range it is often helpful to wrap any call to the blend function with a clipping function that uses the min/max values of that range. This is not part of the library as it is specific to the type of images being blended, but I would definitely recommend it if you are working with natural images (encoded as 0-1, if they are 0-255 you should clip with those values instead).