Page 1 of 1

Pdf->jpg black background [SOLVED]

Posted: 2012-09-06T08:24:54-07:00
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

Re: Pdf->jpg black background

Posted: 2012-09-06T10:04:14-07:00
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.

Re: Pdf->jpg black background

Posted: 2012-09-06T12:32:28-07:00
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

Re: Pdf->jpg black background

Posted: 2012-09-06T14:25:06-07:00
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

Re: Pdf->jpg black background

Posted: 2012-09-06T17:35:33-07:00
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).

Re: Pdf->jpg black background

Posted: 2012-09-07T01:02:21-07:00
by Jacob K.
Thank you
convert -density 200x200 test.pdf -quality 100 file.jpg
works perfectly