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

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
danromeo

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

Post 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!
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

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

Post 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
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
danromeo

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

Post by danromeo »

Thanks for the help. Neither image contains an alpha channel. Two BMP's, no alpha.
Post Reply