Wrong and different background converting pdf to png or tiff

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
HeiHon
Posts: 5
Joined: 2011-03-15T07:58:14-07:00
Authentication code: 8675308

Wrong and different background converting pdf to png or tiff

Post by HeiHon »

When converting "usual" pdf files to png and/or tiff convert renders different (wrong) background.

By "usual" pdf files I mean pdf files that look like black text on white paper but in fact are black text on transparent background.
But of course these pdf files are normally (by pdf readers) rendered as black text on white background.

Anyway, doing e.g.

Code: Select all

convert Acrobat_Reader_ReleaseNote_9.3.4_8.2.4.pdf Acrobat_Reader_ReleaseNote_9.3.4_8.2.4.png
you get png files with gray (not transparent) background
and doing

Code: Select all

convert Acrobat_Reader_ReleaseNote_9.3.4_8.2.4.pdf Acrobat_Reader_ReleaseNote_9.3.4_8.2.4.tiff
you get a tiff file with black background which makes it a little hard to read the text.

imagemagick 6.6.8-4 Q16 + ghostscript 9.01 + WindowsXP SP3

I found this viewtopic.php?f=3&t=18001#p68344 and yes, changing pngalpha to pnmraw helped.

But IMHO using convert without any options should render white (preferable) or transparent background and at least the fact that it renders gray background for png and black background for tiff is a bug.
HeiHon
Posts: 5
Joined: 2011-03-15T07:58:14-07:00
Authentication code: 8675308

Re: Wrong and different background converting pdf to png or

Post by HeiHon »

Sorry, my wrong:
In fact the png files produced by "convert file.pdf file.png" ARE transparent.
My image viewer needed a restart to show the transpareny :-(

Please excuse me.

So at least for my needs I will have pnmraw instead of pngalpha in my delegates.xml.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Wrong and different background converting pdf to png or

Post by magick »

You can use the pngalpha device and add +matte to your command line. The +matte turns off transparency.
HeiHon
Posts: 5
Joined: 2011-03-15T07:58:14-07:00
Authentication code: 8675308

Re: Wrong and different background converting pdf to png or

Post by HeiHon »

Thanks for the reply.

I normally use ImageMagick via the perl Image::Magick module.

As I wrote in my other post
viewtopic.php?f=7&t=18285
there seems to be another way from the command line.
However, one of my problems is, that there doesn't seem to be an easy way to translate the command line args to properties to be set with the perl $image object.

But thanks, I will try matte settings.
Post Reply