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?
Add image as alpha?
-
- Posts: 1
- Joined: 2015-04-21T19:40:23-07:00
- Authentication code: 6789
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Add image as alpha?
What version of Imagemagick and what platform? Please always provide that as syntax may be different.
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
Code: Select all
convert texture1_normal texture1_gloss -compose copy_opacity -composite texture1_normal
see http://www.imagemagick.org/Usage/compose/#copyopacity