Easily strip alpha channel from images in Mathematica
What 开发者_开发技巧is the simplest way to strip the alpha channel (and possible convert images to greyscale) in Mathematica?
I would like to use ImageAssemble
, but some of the images come with and some without an alpha channel. Is there a simpler built-in way than manipulating the ImageData
directly?
The RemoveAlphaChannel
function will do this.
For Mathematica 7, I believe this works:
ColorCombine@Most@ColorSeparate@# &
It's not robust at this point, but type checking could be added.
Your second question (not sure it is) conversion to grayscale, is done with:
ColorConvert[image, "Grayscale"]
精彩评论