Page 1 of 1

Confessed NewB: Help with compositing alpha images to bmp's

Posted: 2009-10-14T16:22:27-07:00
by danromeo
Hey, thanks for taking the time to read this.

I needed a command line program that would perform some 'simple' functions on several thousand files...found IM and BOY, what a program!!

However, I'm more focused on getting these images than I am on learning such a complex app at the moment...was hoping that somebody here would slip me an easy answer and send me on my way!

SO....I have two .bmp's that I want to combine, however one of them needs to behave like a greyscale mask, so that the composite image contains the full pixel info from the color image wherever the mask is white, is entirely black wherever the mask is black, and would contain a 50% mix between the two images wherever the mask is 50% grey, etc..

Again, this needs to be done from the command line...I have several thousand of these image pairs.

ALSO...if it would be easier, I do have the combined images in .DDS format w/ alpha, but I need to convert to .BMP, again with the alpha channel as grey values in the BMP.

After TRYING to understand all of the IM options for alpha channels etc., I decided to take the cowards way out and beg for help, for which I would be much appreciative.

THANKS!

Re: Confessed NewB: Help with compositing alpha images to bmp's

Posted: 2009-10-14T18:01:44-07:00
by anthony
Assuming neither image actually contains transparency... use compose multiply

Anywhere that is black will become black, anywhere the mask is white will be left as is.
See Compose Multiply
http://www.imagemagick.org/Usage/compse/#multiply
Also Mathematical Composition Masking
http://www.imagemagick.org/Usage/channels/#compose

Re: Confessed NewB: Help with compositing alpha images to bmp's

Posted: 2009-10-14T18:43:42-07:00
by danromeo
Thanks for the help. Neither image contains an alpha channel. Two BMP's, no alpha.