Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In order to convert a PDF with 100 pages to single PNG files, I've been using the following command:

C:\Program files\ImageMagick\convert -density 150 -alpha Opaque file.pdf file.png

But that resulted in PNGs that were over-saturated. This is why I modified the command to the following one, adding the colorspace parameter:

C:\Program files\ImageMagick\convert -colorspace sRGB -density 150 -alpha Opaque file.pdf file.png

The colors look good now. However, only the first page of the PDF is converted now, all others are just dropped. Why? Is the order of the arguments wrong? I've tested different orders but none with success.

However, accessing the subsequent pages directly (via file.pdf[1] etc.) works. But why doesn't it convert the full document in batch anymore?

ImageMagick version info:

Version: ImageMagick 6.8.1-9 2013-01-04 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: OpenMP
Delegates: bzlib freetype jp2 jpeg lcms lzma ps tiff x xml zlib
share|improve this question

1 Answer 1

up vote 0 down vote accepted

I used the following little workaround to solve the problem, but I don't like it, obviously:

for /L %%p in (1,1,100) do C:\ImageMagick\convert -colorspace sRGB -density 150 -alpha Opaque file.pdf[%%p] file-%%p.png

Edit: There's a better solution as well:

  1. In ImageMagick's delegates.xml, in section <delegate decode="ps:alpha" replace sDEVICE=pngalpha by sDEVICE=pnmraw
  2. Use C:\ImageMagick\convert -colorspace sRGB -density 150 -alpha off file.pdf file.png
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.