Pdf->jpg black background [SOLVED]

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
Jacob K.
Posts: 3
Joined: 2012-09-06T08:18:27-07:00
Authentication code: 67789

Pdf->jpg black background [SOLVED]

Post by Jacob K. »

I know that this has been addressed before, but I cannot find a solution for my issue. I am running Fedora 16, recently upgraded from F14. While in F14 I could sucuessfully convert any pdf to a jpg with this simple line
convert -geometry 1600x1600 -density 200x200 -quality 100 file.pdf file.jpg
now, no mater which pdf I try, i get a black background. I have tried to set the background to white, no luck. I have tried to convert to a png and I get a white background) but then when I go png->jpg, the black comes back. I have tried to remove alpha with this
convert test.png -background white -alpha remove alpha_remove.png
and I get an error
convert: UnrecognizedAlphaChannelType `remove' @ error/convert.c/ConvertImageCommand/657.

Any thoughts?
Thank you
Last edited by Jacob K. on 2012-09-07T01:02:43-07:00, edited 1 time in total.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Pdf->jpg black background

Post by fmw42 »

What version of IM do you now have on your new system and what did you have on your old system? Sounds like it might have reverted to a very old version of IM.
Jacob K.
Posts: 3
Joined: 2012-09-06T08:18:27-07:00
Authentication code: 67789

Re: Pdf->jpg black background

Post by Jacob K. »

I do not know what I had on F14.
now i have
Version: ImageMagick 6.7.0-10 2012-08-11 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Pdf->jpg black background

Post by fmw42 »

Jacob K. wrote:I do not know what I had on F14.
now i have
Version: ImageMagick 6.7.0-10 2012-08-11 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP
-alpha remove was only added at IMv6.7.5 see http://www.imagemagick.org/Usage/masking/#alpha_remove

convert -geometry 1600x1600 -density 200x200 -quality 100 file.pdf file.jpg
I am not sure that -geometry does anything here. It is a setting that has in your example no operator to use it. Though there are some strange uses of -geometry. So I am not totally sure here. See http://www.imagemagick.org/script/comma ... p#geometry and http://www.imagemagick.org/Usage/resize/#geometry

Also -quality should be set after reading the pdf and before writing the jpg
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Pdf->jpg black background

Post by anthony »

Nope geometry is not used here, and in fact may interfere as it is a partical operator in some condintions (resize).

Even if it is needed I would avoid its 'resize' feature, and in the above example may produce a 'no image to resize' error, in IMv7. (whcih will never 'save' operators for for later use).
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Jacob K.
Posts: 3
Joined: 2012-09-06T08:18:27-07:00
Authentication code: 67789

Re: Pdf->jpg black background

Post by Jacob K. »

Thank you
convert -density 200x200 test.pdf -quality 100 file.jpg
works perfectly
Post Reply