To the ImageMagick wizards and problem solvers:
I need help extracting the mask from a tga file and have tried all of the following before posting here:
convert file.tga -channel matte -separate +channel -negate file_1.tga
convert file.tga -channel matte -negate -separate file_2.tga
convert file.tga -fx 'A' +matte file_3.tga
I also tried the colorize method.
None of these produce the true alpha channel by itself (as I can get using Final Cut Pro's extract matte tool so I know it's there). What am I missing here? Is there a problem with the image not getting processed in true RGBA space (a problem seen in another post)?
This is for a video playback system at our TV station. Our sequencer plays the animation on one channel while the other channel plays the black & white traveling matte so we can key the animation over another video source. I need the one tga file split into two files: the animation file and the matte file.
Any help would be appreciated! Thanks!
Masks, Mattes, Transparencies and Keys
-
- Posts: 1015
- Joined: 2005-03-21T21:16:57-07:00
Re: Masks, Mattes, Transparencies and Keys
Using "matte" as a channel will be interpreted as Magenta! You should use "alpha" and then your first command should do what you want.
Pete
Pete
Re: Masks, Mattes, Transparencies and Keys
Here's the weirdness... the command works with png files, but doesn't work with tga files. It seems like IM flattens the tga to straight RGB before I get a chance to work with the alpha channel.
With this in mind, I tried an experiment:
Using Apple's Preview (which supports Alpha channels), I exported a png from the original tga that preserved the transparencies and then ran the following ImageMagick command: It worked on the png file but not the tga.
I wish IM could handle TARGA alpha channels so I can get my project done easily and simply. Any other thoughts or solutions?
With this in mind, I tried an experiment:
Using Apple's Preview (which supports Alpha channels), I exported a png from the original tga that preserved the transparencies and then ran the following ImageMagick command:
Code: Select all
convert file.png -channel alpha -negate -separate out.png
I wish IM could handle TARGA alpha channels so I can get my project done easily and simply. Any other thoughts or solutions?
-
- Posts: 1015
- Joined: 2005-03-21T21:16:57-07:00
Re: Masks, Mattes, Transparencies and Keys
Can you post a link to an example TGA file?
Pete
Pete
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Masks, Mattes, Transparencies and Keys
That shouldn't ne happening. The 'matte' should match on the the specificel_supremo wrote:Using "matte" as a channel will be interpreted as Magenta! You should use "alpha" and then your first command should do what you want.
channel strings, as given by
Code: Select all
convert -list channel
Note "Magenta" is a short cut for the second color channel, whcih is also exactly the same as "green" is the second is green or magenta depend on the 'colorspace' of the image stored in memory.
See ColorSpace
http://www.imagemagick.org/Usage/basics/#colorspace
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/