Converting PDF to TIFF lost transparent

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
hout827
Posts: 5
Joined: 2016-12-08T03:37:14-07:00
Authentication code: 1151

Converting PDF to TIFF lost transparent

Post by hout827 »

I convert a PDF to image by following commands,

Code: Select all

ImageMagick-7.0.1-Q16> convert C:\tog\test.pdf[0] -channel rgba -alpha on c:\tog\Test2.tiff

Code: Select all

ImageMagick-7.0.1-Q16> convert C:\tog\test.pdf[0] -channel rgba -alpha on PNG32:c:\tog\Test2.png
The png image has a transparent backgound, but the tiff image has a white background.
I expect tiff has transparent background too.
Can any one give me some advice?
Thank you in advance!
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Converting PDF to TIFF lost transparent

Post by snibgo »

What version of Ghostscript are you using? If older than 9.19, I suggest you upgrade it.

Try "-background none" before for the input pdf.
snibgo's IM pages: im.snibgo.com
hout827
Posts: 5
Joined: 2016-12-08T03:37:14-07:00
Authentication code: 1151

Re: Converting PDF to TIFF lost transparent

Post by hout827 »

Thanks for reply.
My Ghostscript is 9.19
And I tested again with '-background none', but the result is same, output tiff has white background still.

Code: Select all

ImageMagick-7.0.1-Q16>convert -background none c:\tog\Test.pdf  -channel rgba -alpha on C:\tog\Test.tif
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Converting PDF to TIFF lost transparent

Post by fmw42 »

Post your PDF to some place such as dropbox.com so we can test with it and put the URL here.
hout827
Posts: 5
Joined: 2016-12-08T03:37:14-07:00
Authentication code: 1151

Re: Converting PDF to TIFF lost transparent

Post by hout827 »

Download the PDF by link below, please
https://1drv.ms/b/s!AjMC3ybiy8i7gQwA4OwFk84HKoLa
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Converting PDF to TIFF lost transparent

Post by fmw42 »

Both these commands produce transparent images on my IM 6.9.6.7 Q16 and IM 7.0.3-9 Q16 Mac OSX with


PNG* PNG rw- Portable Network Graphics (libpng 1.6.24)

TIFF* TIFF rw+ Tagged Image File Format (LIBTIFF, Version 4.0.6)

Code: Select all

convert Test.pdf test.png

convert Test.pdf test.tif
Check your version of libtiff with

Code: Select all

convert -list format
hout827
Posts: 5
Joined: 2016-12-08T03:37:14-07:00
Authentication code: 1151

Re: Converting PDF to TIFF lost transparent

Post by hout827 »

ImageMagick-7.0.1-Q16 in Win10,
PNG* PNG rw- Portable Network Graphics (libpng 1.6.20)
TIFF* TIFF rw+ Tagged Image File Format (LIBTIFF, Version 4.0.6)

Is it a bug of Imagemagick Windows version only?
:(
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Converting PDF to TIFF lost transparent

Post by snibgo »

v7.0.1 was the first of the v7 releases, and not entirely free of bugs, shall we say. I suggest you try a more recent version.
snibgo's IM pages: im.snibgo.com
hout827
Posts: 5
Joined: 2016-12-08T03:37:14-07:00
Authentication code: 1151

Re: Converting PDF to TIFF lost transparent

Post by hout827 »

Thanks for suggestion.
But tested in v7.0.3 (in win10), same issue.
tif has white background, and png's background is transparency.
Post Reply