Page 1 of 1

Convert TIF to PNG with Transparency

Posted: 2018-01-29T04:57:36-07:00
by schille
I am trying to convert the tif file (Download URL given below) to PNG. The tif file has a transparent background which turns white after the conversion. I want to preserve the transparency.

Image Magick Version: ImageMagick 7.0.4-6 Q16 x64 2017-01-27 http://www.imagemagick.org
OS: Windows 10 64 bit (x64)

Tif File:
-file was created with Photoshop (Adobe Photoshop CC (Windows))
-file has a completely transparent background
-file has one layer in photoshop
-file has NO Alpha channel (8 bit RGB channels)
-file has a clipping path

The URL to the file:
http://2app.ws/SalusRGB.tif

Command I tried:

Code: Select all

convert SalusRGB.tif[0] Salus.png
Can anyone help me to find a command preserving the transparency in the output image?

Re: Convert TIF to PNG with Transparency

Posted: 2018-01-29T07:55:09-07:00
by schille
Another useful info:
Every image viewer i use also removes the transparency of the TIF file and makes the background white.
Only Photoshop shows the transparency of the image.

Re: Convert TIF to PNG with Transparency

Posted: 2018-02-04T23:59:01-07:00
by schille
Can anyone help please?

thanks in advance

Re: Convert TIF to PNG with Transparency

Posted: 2018-02-05T00:20:15-07:00
by fmw42
Try this. The -size argument is the size of layer 0 from identify -verbose. But layer 0 has white background. Layer 1 is just the bounds of the image and can be composited at its internal offset using -layers merge over a transparent background of the size of the layer 0.

Code: Select all

convert -quiet -size 4724x4724 xc:none SalusRGB.tif[1] -background none -layers merge +repage SalusRGB.png

Re: Convert TIF to PNG with Transparency

Posted: 2018-02-05T00:26:23-07:00
by schille
This works, thank you so much!