TIFF with path to PNG with transparency

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
SuperCed

TIFF with path to PNG with transparency

Post by SuperCed »

Hi,

I am searching for a process to change TIFF with path embeded inside to a PNG using this path to make transparency.

So when I open my TIFF image with Photoshop, I have the image and a path.

And, then I want to make transparency for a PNG file with this same path.

Is it possible?

How can I do it sing Imagemagick command line tool?

My tiff image :
http://superced.dyndns.org/test/test_mask.tif

Thank you!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: TIFF with path to PNG with transparency

Post by fmw42 »

I am very confused about what you are trying to do. Please provide more details. How do you put a tif inside a png? Can you provide an example of what you are trying to do?

Is there some tif file with some kind of clip path inside it? Do you want to convert the tif to png so that the area inside the clip path is transparent?

Please provide a link to your tif file.
SuperCed

Re: TIFF with path to PNG with transparency

Post by SuperCed »

fmw42 wrote: Is there some tif file with some kind of clip path inside it? Do you want to convert the tif to png so that the area inside the clip path is transparent?
Yes, that's it.
I want to transform the tiff image into png image.
I also want thats the area outside the path embeded in the tiff file will be transparent in the png file.

I put a link to the tiff file. If you open it in Photoshop, you'll see the path.
Then I want to transform it to png and use the path to make transparency.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: TIFF with path to PNG with transparency

Post by fmw42 »

This seems to work, but I cannot say it is the best or most efficient way. Perhaps Anthony can comment. This is the first time I have tried using -clip and clip paths (and +clip seems to be needed, works, but is undocumented)

see http://www.imagemagick.org/script/comma ... s.php#clip


Image

convert test_mask.tif \
\( -clip -alpha transparent -clone 0 -alpha extract +clip -negate \) \
-compose copy_opacity -composite test_mask.png

or

convert test_mask.tif \
\( -clip -threshold 100% -clone 0 +clip -fill white +opaque black -negate \) \
-compose copy_opacity -composite test_mask.png

Image

The result may not be what you expect as the clip path does not follow the face, but is outside the face.
SuperCed

Re: TIFF with path to PNG with transparency

Post by SuperCed »

That's exactly what I wanted!

Great!

Thank you so much!

I will try it soon.
SuperCed

Re: TIFF with path to PNG with transparency

Post by SuperCed »

That's great!

It works perfectly. I don't know which is the best command.
Both seem to work well.

What do you think about this?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: TIFF with path to PNG with transparency

Post by fmw42 »

equal, don't see why one is better than the other. take your pick.
Post Reply