create a tif with a transparent background

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
davidrhicks
Posts: 4
Joined: 2012-10-17T10:03:32-07:00
Authentication code: 67789

create a tif with a transparent background

Post by davidrhicks »

Our company has several tif images of products which need transparent backgrounds. We cannot simply make white transparent because white may be in the product. What would be the "command line" way of taking a tif image and making its background transparent? To be more specific, can we use a clipping path and save it onto a transparent background?

An example of how to use the ImageMagick object's "Convert" function to accomplish this would also be helpful.

Thanks ahead of time!

P.S. We are using ImageMagick version 6.7.8-2 on a Windows platform. The language in which I am using the ImageMagick object is vbscript.
Last edited by davidrhicks on 2012-10-17T10:29:24-07:00, edited 2 times in total.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: create a tif with a transparent background

Post by Bonzo »

davidrhicks
Posts: 4
Joined: 2012-10-17T10:03:32-07:00
Authentication code: 67789

Re: create a tif with a transparent background

Post by davidrhicks »

Thanks for the suggested link. I checked it out, but it isn't in line with what we are trying to accomplish. We are hoping to use a clipping path and then save the image onto a transparent background.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: create a tif with a transparent background

Post by fmw42 »

see http://www.imagemagick.org/Usage/masking/#clip there is an example how to make the outside of the clip area transparent.

Also note
viewtopic.php?f=3&t=22074
viewtopic.php?f=3&t=22081
viewtopic.php?f=1&t=22069
davidrhicks
Posts: 4
Joined: 2012-10-17T10:03:32-07:00
Authentication code: 67789

Re: create a tif with a transparent background

Post by davidrhicks »

For anyone interested, we found a way to do it. Here is the command line way:

convert test.tif -alpha transparent -clip-path #1 -alpha opaque test2.tif
Post Reply