Message Boards Message Boards

What is the logic of transparency handling by image-processing functions?

GROUPS:

When working on this post I discovered that starting from Mathematica 10.0 the behavior of such functions as Blur, GaussianFilter, ImageConvolve and some others was changed. Namely, they no longer affect alpha channel of an Image they are applied to. Unfortunately the Documentation is completely silent about this important change which has broken all dependent code, including this ingenious function written by Heike.

My interpretation was that the purpose of this incompatible change is to make transparency handling by all image processing functions be consistent. In versions 8 and 9 ImageAdjust, Dilation and some other similar functions weren't applied to alpha channel. The consistent implementation is to make them all to ignore alpha channel or make them all to process alpha channel (or, better, make this behavior optional). But further investigation showed that even in the latest version 11.2.0 there are strongly related functions which still affect alpha channel: ImageCorrelate and ImageFilter (and may be others, I didn't test every function).

Is it a bug that ImageCorrelate and ImageFilter still affect alpha channel? If so, we should expect another code-breaking change in one of the future releases of Mathematica.

Or is it by design and we can rely on this functionality? If so, what is the logic behind this design decision? Currently I see no way to predict this behavior, and there is also no information in the Docs. Is there any method to know besides testing every function by hand?

(Cross-posted on Mathematica.SE.)

POSTED BY: Alexey Popkov
Answer
22 days ago

At the moment I can just tell you that the issue is known and internal teams are looking into this. Please stay tuned for resolution. Thanks for bringing this up and taking the time to describe it.

POSTED BY: Vitaliy Kaurov
Answer
14 days ago

Group Abstract Group Abstract