开发者

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"]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜