I have a book scan as a pdf. When I open it with Adobe Reader, it looks like grayscale. When I open it with IrfanView, it looks like grayscale, and the Information option tells me that the image is actually 24 bit (I don't know if this is the real bit depth of the image embedded in the pdf or if IrfanView assigns the maximal depth when opening a pdf as image).

enter image description here

I want to OCR the scan with OmniPage SE. It doesn't read PDF, so I decided to use ImageMagick to convert the file to PNG first. But no matter what I try, the output is always monochrome and practically unreadable.

enter image description here

I tried different conversion lines, with different depth, density and resize values, but it didn't help. What you see was made with the options convert testfile.pdf -density 600x600 -depth 8 PNG:testfile.png.

Any idea what causes the problem?

Edit: To make it clear, the output looks like this for any value of -density, -depth and -resize I have tried. It also looks like that when I use no options at all, as in convert testfile.pdf PNG:testfile.png.

  • Did you figure this out? I need it too! – xcorat Oct 22 '15 at 4:42

Try changing "-depth 8" to "-depth rgb" (or "-depth cmyk").

| improve this answer | |
  • Magick: invalid argument for option `-depth': rgb @ error/convert.c/ConvertImage Command/1167. Looks like it isn't a valid argument, but cannot look it up because imagemagick.org seems to be down, I cannot access the google cached version either. – rumtscho Mar 10 '11 at 18:04
  • Hmm, my next comment is from the documentation. I'm in error as I mis-read it. Try "-depth 24" for 24-bit colour. – Randolf Richardson Mar 11 '11 at 15:38
  • -depth valuedepth of the image.<br><br>This the number of bits in a color sample within a pixel. Use this option to specify the depth of raw images whose depth is unknown such as GRAY, RGB, or CMYK, or to change the depth of any image after it has been read. – Randolf Richardson Mar 11 '11 at 15:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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