So, I have an original image and a modified version of the same image with a transparent foreground. Both images (including the foreground in the modified image) seem to have transparency. What I want to do is remove the original image portion from the modified image so I get the transparent foreground by itself with no traces of the original image. What command should I use to achieve this?
ImageMagick Version: ImageMagick 6.9.3-4 Q16 x64 2016-02-13 (Running on Windows 10)
Extract Transparent Foreground From Image
-
- Posts: 27
- Joined: 2016-03-11T07:27:11-07:00
- Authentication code: 1151
Extract Transparent Foreground From Image
Last edited by coolperez8 on 2016-04-04T15:41:20-07:00, edited 1 time in total.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Extract Transparent Foreground From Image
I don't understand. If you remove the original image apart from the transparent foreground, what are you left with? Example images might help.
Please also read the IMPORTANT: Please Read This FIRST Before Posting thread.
Please also read the IMPORTANT: Please Read This FIRST Before Posting thread.
snibgo's IM pages: im.snibgo.com
-
- Posts: 27
- Joined: 2016-03-11T07:27:11-07:00
- Authentication code: 1151
Re: Extract Transparent Foreground From Image
Basically, you remove the original image from the modified image and you're left with the transparent foreground.snibgo wrote:I don't understand. If you remove the original image apart from the transparent foreground, what are you left with? Example images might help.
Please also read the IMPORTANT: Please Read This FIRST Before Posting thread.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Extract Transparent Foreground From Image
How about:
Code: Select all
convert in.png -alpha transparent out.png
snibgo's IM pages: im.snibgo.com
-
- Posts: 27
- Joined: 2016-03-11T07:27:11-07:00
- Authentication code: 1151
Re: Extract Transparent Foreground From Image
That did not work, it just made the entire image transparent.snibgo wrote:How about:Code: Select all
convert in.png -alpha transparent out.png
Plus, I am trying to remove a known background of an image that has a transparent foreground.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Extract Transparent Foreground From Image
If you just want the alpha channel of the image (transparency) use
Code: Select all
convert image.png -alpha extractf alphachannel.png
-
- Posts: 27
- Joined: 2016-03-11T07:27:11-07:00
- Authentication code: 1151
Re: Extract Transparent Foreground From Image
Actually, what I'm trying to do is remove a known background from an image, although the foreground is transparent.fmw42 wrote:If you just want the alpha channel of the image (transparency) use
Code: Select all
convert image.png -alpha extractf alphachannel.png
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Extract Transparent Foreground From Image
If you remove the background channels, all you are left with is the alpha channel.
If you want the background area of the image to be removed in the sense of making it black (or white or some other color), leaving the opaque foreground and transparency still where the background exists, then use
If you want the background area of the image to be removed in the sense of making it black (or white or some other color), leaving the opaque foreground and transparency still where the background exists, then use
Code: Select all
convert image -background black -alpha background result