Convert PDF to JPG: 64-Bit Postscript delegate. Please help

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.
vielhuber
Posts: 23
Joined: 2010-09-05T15:40:14-07:00
Authentication code: 8675308

Re: Convert PDF to JPG: 64-Bit Postscript delegate. Please h

Post by vielhuber » 2011-09-30T12:08:45-07:00

Can you convert the second one also please?

User avatar
magick
Site Admin
Posts: 11015
Joined: 2003-05-31T11:32:55-07:00

Re: Convert PDF to JPG: 64-Bit Postscript delegate. Please h

Post by magick » 2011-09-30T12:31:02-07:00

Not sure what you mean. We're using ImageMagick 6.7.2-8, the current release and Ghostscript 9.04 and we can convert both PDF's without complaint. We get excellent results with supersampling:
  • convert -density 400 test1.pdf -resize 25% test1.png

vielhuber
Posts: 23
Joined: 2010-09-05T15:40:14-07:00
Authentication code: 8675308

Re: Convert PDF to JPG: 64-Bit Postscript delegate. Please h

Post by vielhuber » 2011-09-30T12:38:13-07:00

Another machine (just set up, everything new). Have got GS 9.04 and IM 6.7.2-9.

convert -density 400 test1.pdf -resize 25% test1.png
Image
convert -density 400 test2.pdf -resize 25% test2.png
Image

Surprisingly good results.

convert -density 400 test1.pdf -resize 25% test1.jpg
Image
convert -density 400 test2.pdf -resize 25% test2.jpg
Image

What's wrong with my JPG-delegate?!

vielhuber
Posts: 23
Joined: 2010-09-05T15:40:14-07:00
Authentication code: 8675308

Re: Convert PDF to JPG: 64-Bit Postscript delegate. Please h

Post by vielhuber » 2011-09-30T12:40:24-07:00

Without density and resize:

convert test.pdf test.jpg
Image

vielhuber
Posts: 23
Joined: 2010-09-05T15:40:14-07:00
Authentication code: 8675308

Re: Convert PDF to JPG: 64-Bit Postscript delegate. Please h

Post by vielhuber » 2011-09-30T12:44:17-07:00

The "ghostscript"-Problem is now finished, because I can obviously produce PDF to PNG.
But it seems that the PNG to JPG conversion fails or shows a strange behaviour.

vielhuber
Posts: 23
Joined: 2010-09-05T15:40:14-07:00
Authentication code: 8675308

Re: Convert PDF to JPG: 64-Bit Postscript delegate. Please h

Post by vielhuber » 2011-09-30T12:57:13-07:00

Watch this behaviour:

PNG-File
Image

convert no.png no.jpg

JPG-File
Image

Have you seen it before?

User avatar
magick
Site Admin
Posts: 11015
Joined: 2003-05-31T11:32:55-07:00

Re: Convert PDF to JPG: 64-Bit Postscript delegate. Please h

Post by magick » 2011-09-30T12:59:54-07:00

Add -colorspace RGB before your JPEG image filename on the command line. Otherwise there may be a problem with your JPEG delegate library.

vielhuber
Posts: 23
Joined: 2010-09-05T15:40:14-07:00
Authentication code: 8675308

Re: Convert PDF to JPG: 64-Bit Postscript delegate. Please h

Post by vielhuber » 2011-09-30T13:11:24-07:00

Image

I made one half transparent with photoshop (to test) and the other not.

convert what.png -colorspace RGB what.jpg

Image

I hope the command I did to load the gs libraries

Code: Select all

apt-get install ghostscript imagemagick libmagick9-dev libmagickcore-dev libmagickwand-dev
did not ruin my whole environment.
And yes, I did a ./configure make make install afterwards!

User avatar
fmw42
Posts: 25274
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert PDF to JPG: 64-Bit Postscript delegate. Please h

Post by fmw42 » 2011-09-30T13:22:51-07:00

JPG does not support transparency.

vielhuber
Posts: 23
Joined: 2010-09-05T15:40:14-07:00
Authentication code: 8675308

Re: Convert PDF to JPG: 64-Bit Postscript delegate. Please h

Post by vielhuber » 2011-09-30T13:23:08-07:00

All my JPEG delegates are loaded properly:

Code: Select all

JBIG              --with-jbig=yes		no
JPEG v1           --with-jpeg=yes		yes
JPEG-2000         --with-jp2=yes		yes
LCMS v1           --with-lcms=yes		yes
Look at full config.log
http://vielhuber.de/files/config.log

vielhuber
Posts: 23
Joined: 2010-09-05T15:40:14-07:00
Authentication code: 8675308

Re: Convert PDF to JPG: 64-Bit Postscript delegate. Please h

Post by vielhuber » 2011-09-30T13:24:28-07:00

I know that. But this behaviour wasn't seen on previous versions of IM.
How can I fix that. And in your environment everything is working.

User avatar
fmw42
Posts: 25274
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert PDF to JPG: 64-Bit Postscript delegate. Please h

Post by fmw42 » 2011-09-30T13:32:49-07:00

perhaps your libjpeg is old and needs upgrading or your libpng (or both)?

Also perhaps one of the delegate libraries that GS needs to use, also needs upgrading?

what do you get from

convert -list configure

look at the line starting with DELEGATES.
Last edited by fmw42 on 2011-09-30T13:34:14-07:00, edited 1 time in total.

vielhuber
Posts: 23
Joined: 2010-09-05T15:40:14-07:00
Authentication code: 8675308

Re: Convert PDF to JPG: 64-Bit Postscript delegate. Please h

Post by vielhuber » 2011-09-30T13:33:54-07:00

Code: Select all

DELEGATES     bzlib djvu fontconfig freetype gvc jpeg jng jp2 lcms lqr openexr png rsvg tiff x11 xml wmf zlib
Delegates seem to be OK!

I'm so happy, i did it the following way:

Code: Select all

convert test1.pdf test1.png

Code: Select all

convert test1.png -background white -flatten +matte test1.jpg
Result:
Image

This works!
Is there a better way and faster way to do it?

Code: Select all

convert test1.pdf test1.jpg
and also

Code: Select all

convert -colorspace RGB test1.pdf -colorspace RGB test1.jpg
does not work.
Result:
Image

It's the alpha channel, which gets worse when converting directly.

Thank you so much. My problem was consisting of two problems:
- Ghostscript delegates not loaded
- Conversion of PNG alpha channel to JPG

With the help of you I did both.

Another question: You have to provide commercial support for your product! :-)
Last edited by vielhuber on 2011-09-30T13:44:59-07:00, edited 1 time in total.

User avatar
magick
Site Admin
Posts: 11015
Joined: 2003-05-31T11:32:55-07:00

Re: Convert PDF to JPG: 64-Bit Postscript delegate. Please h

Post by magick » 2011-09-30T13:42:51-07:00

For commercial support, post a message to http://www.imagemagick.org/script/contact.php. Choose Sponsorship Query as the issue.

vielhuber
Posts: 23
Joined: 2010-09-05T15:40:14-07:00
Authentication code: 8675308

Re: Convert PDF to JPG: 64-Bit Postscript delegate. Please h

Post by vielhuber » 2011-09-30T13:48:07-07:00

Code: Select all

convert -background white -flatten test1.pdf test1.jpg
works!
The flatten parameter makes the alpha layer of the PDF disable and everything is now in combination with the new versions of IM and GS fine

Thank you again for your support.
You have to take money from companies for your knowledge!!!

Post Reply