7
$\begingroup$

(Cross-posted on Wolfram Community.)

When working on the answer to this question 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. 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?

$\endgroup$
1
  • 5
    $\begingroup$ It looks like the general trend is to remove alpha channel processing, so I'd expect another change in a future version. I wish they would just give every image processing function a ProcessAlphaChannel option so that the user can simply specify what behaviour they want. $\endgroup$ Sep 23, 2017 at 9:04

1 Answer 1

2
$\begingroup$

Sorry, no specific Mathematica-related answer for you, but we hope that in the long term Mathematica implements something consistent with this paper: Glassner, Andrew (2015), "Interpreting Alpha", Journal of Computer Graphics Techniques 4 (2): 30–44.

$\endgroup$
2
  • $\begingroup$ Thank you, the paper is very enlightening! $\endgroup$ Sep 23, 2017 at 17:44
  • $\begingroup$ @Alexey, in fact the whole journal is chockful of useful tricks. And free, too! $\endgroup$ Sep 24, 2017 at 12:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.