Page 1 of 1

Add image as alpha?

Posted: 2015-04-21T19:55:23-07:00
by nonfatmatt
I'm working on a game development project and the engine I'm using needs a gloss map (which is a black and while image) added as an alpha layer to the normal map (which is an RGB image with no alpha). In Gimp I've been trying to copy my black and white gloss map into the alpha channel of the normal map to no avail (for some reason the channel selection is off). I've been through ImageMagick manual but can't seem to find how to do this or where to start. Basically I would have two filenames, like so:

texture1_normal
texture1_gloss

And I need to output one image called texture1_normal that has texture1_gloss as its alpha channel. Both images are the same size. Is there a way to do this with ImageMagick?

Re: Add image as alpha?

Posted: 2015-04-21T20:19:02-07:00
by fmw42
What version of Imagemagick and what platform? Please always provide that as syntax may be different.

Code: Select all

convert texture1_normal texture1_gloss -compose copy_opacity -composite texture1_normal
But this will overwrite texture1_normal. You may want to change the output name to something different from the input for safety.

see http://www.imagemagick.org/Usage/compose/#copyopacity