Page 1 of 1
Problem with "convert" from a multipage ps file
Posted: 2015-12-08T08:43:08-07:00
by Stefano90
Hello,
I have a problem with conversion from ps to png file:
I have a multipage ps file with some plots, the first page is converted without any problem, this is the result:
http://188.138.57.168/out-0.png
but the other pages are shifted about 40 pixel on top, and I can't understand the reason:
http://188.138.57.168/out-1.png
http://188.138.57.168/out-2.png
...
This is the code i have used:
Code: Select all
convert -geometry 1300x1300 -density 300 -depth 4 gwrf_merc.ps out.png
I tried also -gravity center, crop function, without any change.
Can anyone help me to solve this issue?
Thank you very much,
Stefano G.
Re: Problem with "convert" from a multipage ps file
Posted: 2015-12-08T10:46:15-07:00
by dlemstra
Can you also share your input file and tell us your platform and version of ImageMagick?
Re: Problem with "convert" from a multipage ps file
Posted: 2015-12-08T11:10:37-07:00
by Stefano90
Thank you for yuor answer
I uploaded my ps file (an example of 2 pages):
http://188.138.57.168/gwrf_merc.ps
I use CentOS Linux 7.1.1503
The version of ImageMagick is 6.9.2-5 Q16 x86_64
Re: Problem with "convert" from a multipage ps file
Posted: 2015-12-08T11:12:03-07:00
by fmw42
What delegates do you have installed --- what do you get from
Does the list include gs or gslib (Ghostscript)?
Re: Problem with "convert" from a multipage ps file
Posted: 2015-12-08T11:27:57-07:00
by fmw42
convert -geometry 1300x1300 -density 300 -depth 4 gwrf_merc.ps out.png
-geometry should not be used to resize an image. use -resize. try
Code: Select all
convert -density 300 gwrf_merc.ps -resize 1300x1300 -depth 4 out.png
That seems to work for me on IM 6.9.2.8 Q16 Mac OSX Snow Leopard.
Code: Select all
convert -version
Version: ImageMagick 6.9.2-8 Q16 x86_64 2015-12-07 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules
Delegates (built-in): bzlib cairo fftw fontconfig freetype gslib jbig jng jp2 jpeg lcms lqr ltdl lzma openexr png ps rsvg tiff webp x xml zlib
Note gslib in the list of Delegates.
Re: Problem with "convert" from a multipage ps file
Posted: 2015-12-08T11:51:33-07:00
by Stefano90
This is the response from convert -version
Code: Select all
Version: ImageMagick 6.9.2-5 Q16 x86_64 2015-12-08 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC OpenMP
Delegates (built-in): bzlib freetype gslib jng jpeg png ps tiff x zlib
I tried to copy your new code, but the result is the same:
http://188.138.57.168/out-0.png works fine
http://188.138.57.168/out-1.png cut the upper border
Re: Problem with "convert" from a multipage ps file
Posted: 2015-12-08T12:47:02-07:00
by fmw42
I had not noticed, but mine gets trimmed at the top also. I am sorry, I do not know what else to do. You might try upgrading your Ghostscript.
Mine is a bit old
9.10
Re: Problem with "convert" from a multipage ps file
Posted: 2015-12-08T15:31:36-07:00
by Stefano90
I have 9.15 gs version.
There is a way to shift down the image? Because if you see the bottom corner, it's trasparent. Seems the "convert" function shift up the real image from "container"
Thank you very much,
Stefano.
Re: Problem with "convert" from a multipage ps file
Posted: 2015-12-08T17:19:28-07:00
by fmw42
As I recall, 9.15 had some problems. Try upgrading.
You can use the -roll function to shift the image. See
http://www.imagemagick.org/script/comma ... s.php#roll
You can also pad at the top using either -extent or -splice. See
http://www.imagemagick.org/Usage/crop/#extent and
http://www.imagemagick.org/Usage/crop/#splice