converting PS file with 1000 pages to png takes more time

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.
Post Reply
Ganesha
Posts: 23
Joined: 2014-05-20T06:40:01-07:00
Authentication code: 6789

converting PS file with 1000 pages to png takes more time

Post by Ganesha »

Hi,
I tried converting a book (.ps) containing 737pages using convert command
it takes more time and also I am getting duplicates of the pages of book in png. Can help me in converting the pages correctly and also in less time.
I use the command

Code: Select all

convert testing.ps test.png
Here is the file : https://www.dropbox.com/s/9ai5t7ctwe79a0e/testing.ps
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: converting PS file with 1000 pages to png takes more tim

Post by snibgo »

Each page is 680x800 pixels. There are 737 pages. If you are using Q16, this is 8 bytes/pixel, so takes 3.5 GB of memory. If you don't have that much free, it will use disk, which will be slow.

Q8 will use half that memory.

You could convert in batches, say 100 pages at a time.
snibgo's IM pages: im.snibgo.com
Ganesha
Posts: 23
Joined: 2014-05-20T06:40:01-07:00
Authentication code: 6789

Re: converting PS file with 1000 pages to png takes more tim

Post by Ganesha »

Thanks for the reply . Is there any command in convert to get the count of the pages in ps files?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: converting PS file with 1000 pages to png takes more tim

Post by snibgo »

identify -ping -format %n testing.ps
snibgo's IM pages: im.snibgo.com
Ganesha
Posts: 23
Joined: 2014-05-20T06:40:01-07:00
Authentication code: 6789

Re: converting PS file with 1000 pages to png takes more tim

Post by Ganesha »

Hi,
I tried this command

Code: Select all

convert testing.ps[0-99] test.png
convert testing.ps[100-199] test.png
convert testing.ps[200-299] test.png
convert testing.ps[300-399] test.png
convert testing.ps[400-499] test.png
convert testing.ps[500-599] test.png
convert testing.ps[600-699] test.png
convert testing.ps[700-736] test.png 
as you suggested to convert in batches of 100 pages but at result I am getting the first hundred pages for all the batch . Help me in avoid duplicates also suggest to reduce the time taken.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: converting PS file with 1000 pages to png takes more tim

Post by fmw42 »

as you suggested to convert in batches of 100 pages but at result I am getting the first hundred pages for all the batch . Help me in avoid duplicates also suggest to reduce the time taken.
The numbering of the output images will be the same 0-99, but look carefully at the images. They should be different.

try

Code: Select all

convert testing.ps[0-99] -scene 0 test.png
convert testing.ps[100-199] -scene 100 test.png
etc
Ganesha
Posts: 23
Joined: 2014-05-20T06:40:01-07:00
Authentication code: 6789

Re: converting PS file with 1000 pages to png takes more tim

Post by Ganesha »

Hi,

Code: Select all

convert testing.ps[0-99] test.png
convert testing.ps[100-199] test.png
convert testing.ps[200-299] test.png
convert testing.ps[300-399] test.png
convert testing.ps[400-499] test.png
convert testing.ps[500-599] test.png
convert testing.ps[600-699] test.png
convert testing.ps[700-736] test.png
Let me explain clearly .. after conversion of the images using the above code. I am getting outputs like test-0.png,test-1.png,test-2.png....etc upto test-736.png. The issue I am facing is test-0.png , test-100.png ,test-200.png,test-300.png....test-700.png images resembles the same. Similarly test-1.png , test-101.png ,test-201.png,test-301.png....test-701.png , test-2.png , test-102.png ,test-202.png,test-302.png....test-702.png and so on resembles the same. Help in fixing this issue.
Ganesha
Posts: 23
Joined: 2014-05-20T06:40:01-07:00
Authentication code: 6789

Re: converting PS file with 1000 pages to png takes more tim

Post by Ganesha »

hello any update on this?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: converting PS file with 1000 pages to png takes more tim

Post by fmw42 »

What version of IM and platform are you using? If an old version of IM, perhaps there was a bug and you should upgrade. Also what version of Ghostscript are you using? If that is old, perhaps you should upgrade that as well, since IM relies upon GS to process ps files.

Can you post a link to a ps file with fewer pages?

What happens if you test only the first 3 or 4 groups of 10 pages? Do you get the same kind of result?
Ganesha
Posts: 23
Joined: 2014-05-20T06:40:01-07:00
Authentication code: 6789

Re: converting PS file with 1000 pages to png takes more tim

Post by Ganesha »

Am currently using latest version of Imagemagick (6.8.9-7) and Ghostscript (9.14). And system I use is MAC. I can't perform above action even after the updating, same outputs are listing. Kindly provide me a solution.I get the same kind of results ..
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: converting PS file with 1000 pages to png takes more tim

Post by fmw42 »

IM 6.8.9.7 Q16 Mac OSX
Ghostscript 9.10
libpng 1.6.12_0

I can confirm this appears to be a bug.


I took a multipage PDF and did the same kind of test and it worked fine. But when I converted the file to a multipage PS, I got repeated sets of the first six pages. I then converted the PS back to PDF and repeated and it worked fine again.

This worked:

Code: Select all

convert IDIMS_Training2.pdf[0-5] test.png
convert IDIMS_Training2.pdf[6-12] test.png
This failed:

Code: Select all

convert IDIMS_Training2.ps[0-5] test.png
convert IDIMS_Training2.ps[6-12] test.png

This failed:

Code: Select all

convert IDIMS_Training2.ps[0-5] -scene 0 test.png
convert IDIMS_Training2.ps[6-12] -scene 6 test.png

Work around: Convert the PS file to PDF first and then do the same thing to separate files.

P.S. I had no problems with

Code: Select all

convert IDIMS_Training2.ps test.png
and got all 57 distinct pages
Post Reply