Mogrify from multi-pdf to png to multi-tiff

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
benito2313
Posts: 6
Joined: 2013-04-24T07:17:21-07:00
Authentication code: 6789

Mogrify from multi-pdf to png to multi-tiff

Post by benito2313 »

Hello,

I'm trying to get a multi-pdf to a png and then to a multi-tiff.
But because png cant handle multi pages it puts out "_0" and "_1" after the file name.
My question is how can i put these png files back in a multi tiff (I have multiple pdf with single pages and multiple pages)

i know i can do this directley if i take out the png, but for some reason tesseract doesnt support the file if i do this.

my code now is:
mogrify -denisty 300 -format png +matte *.pdf
mogrify -denisty 300 -format tiff -colorspace Transparent -auto-level -auto-orient +matte *.png

Regards,

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

Re: Mogrify from multi-pdf to png to multi-tiff

Post by fmw42 »

Does this not work?

mogrify -density 300 -format tiff +matte *.pdf

This works fine for me in IM 6.8.4.10 Mac OSX Snow Leopard as a simple test


convert rose: rose: rose: rose.pdf
mogrify -format tiff rose.pdf
benito2313
Posts: 6
Joined: 2013-04-24T07:17:21-07:00
Authentication code: 6789

Re: Mogrify from multi-pdf to png to multi-tiff

Post by benito2313 »

Thats just it it only works wen its an png first and then tiff, but i need it to be à multitiff
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Mogrify from multi-pdf to png to multi-tiff

Post by fmw42 »

benito2313 wrote:Thats just it it only works wen its an png first and then tiff, but i need it to be à multitiff
You misread my post. I started with a multipage pdf and converted using mogrify to a multipage tiff.

The multipage pdf was created from combining 3 rose: images into one multipage pdf, since I did not have any other multipage pdfs around. There is no png involved.

By mult-tiff, do you mean multi-page tiff or a pyramid-tiff?

You also never mention your IM version or platform. Please see viewtopic.php?f=1&t=9620
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Mogrify from multi-pdf to png to multi-tiff

Post by snibgo »

If I wanted to convert a multi-page PDF to a multi-page TIFF via individual PNG files, this is how I would do it:

Code: Select all

convert x.pdf x-%06d.png
convert x-*.png x.tiff
To convert many PDF files, I would put this an a script loop. Perhaps mogrify could do it without a script loop.

However, I'm curious about the tesseract problem. Can you supply a multi-page TIFF that tesseract can use, and one that it can't?
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Mogrify from multi-pdf to png to multi-tiff

Post by fmw42 »

There should be no reason to convert to intermediate png, just to then convert to tiff. Mogrify should handle the multipage pdf to multipage tiff just fine as I demonstrated.
benito2313
Posts: 6
Joined: 2013-04-24T07:17:21-07:00
Authentication code: 6789

Re: Mogrify from multi-pdf to png to multi-tiff

Post by benito2313 »

My problem is solved by using mogrify to .mng file.
Thanx for your help and input

regards,

Benito2313
Post Reply