convert c.eps d.jpg unreliable
Posted: 2007-02-26T21:18:14-07:00
I have used "convert" in the past on a daily basis to automatically convert a large set of EPSF files to jpg format.
(this is part of the displayed data on a web site describing activity at our computing center).
One conversion command is of the form (UNIX style):
convert -density ${DENSITY} -antialias -colors 128 \
-background white -normalize -units PixelsPerInch \
-quality 100 \
c.eps d.jpg
where ${DENSITY} used to be the number 100
Another set of thumbnail sized pictures is produced from the same original
eps files.
This stopped working when we switched to a more recent version of 'convert'.
We presently have:
Version: ImageMagick 6.2.5 12/18/06 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2005 ImageMagick Studio LLC
The convert program works well with some densities, and not with others.
Some tested values were:
DENSITY = 30, 50, 60, 80, 101, 105, 110 working fine
DENSITY = 20, 72, 90, 99, 100 not working
When convert fails, we get a picture of sparse oblique dotted lines, when
the original pictures are either color pie-charts or bar-charts.
My older version of "convert" still works fine on my SGI O2 machine,
at any density, and on the same files that fail with the newer 'convert'. The old version is
Version: @(#)ImageMagick 5.4.1 12/01/01 Q:16 http://www.imagemagick.org
Copyright: Copyright (C) 2001 ImageMagick Studio
But now I need to do the conversions on a SGI Altix (Itanium2 processors), under
Linux version 2.6.16.27-0.6-default (geeko@buildhost) (gcc version 4.1.0 (SUSE Linux)) #1 SMP Wed Dec 13 09:34:50 UTC 2006
I tried changing the density a little bit, just to get the program to work, but
some values worked with some files and not with others. All the EPSF files (there are two varieties)
are created by the same program (developed locally), and are DSC Conforming.
The conversion can be done successfully with the current version of convert
if I first convert from eps to pdf, then to jpg, but then
I loose the BoundingBox information that is necessary for correct cropping of the final
jpg image (recall: this has to be done automatically). Even if I could make this conversion path work
for this particular application, I would much prefer to continue doing the conversions
directly (eps -> jpg), otherwise a lot of script lines would need to be rewritten and checked.
And it is nicer to have reliability.
May be I am not aware of some recent change that may impose new resctrictions on
the input images; do the image dimensions have to be multiples of 8 pixel units in both directions,
for example, to better suit the output format? If Yes, is there an way to tell convert
to add the missing pixels for us, so that I may always get a viewable picture?
Here are sample outputs from a bad, then a good 'convert' run using the
above command and the same input file:
frontal01 532% conv
density=40
"gs" -q -dBATCH -dSAFER -dMaxBitmap=500000000 -dNOPAUSE -dAlignToPixels=0
"-sDEVICE=bmpsep8" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-g179x143"
"-r40x40" "-sOutputFile=/tmp/magick-XXXWlpv1" "-f/tmp/magick-XXWfkS2B"
"-f/tmp/magic0rMWXq"/tmp/magick-XXXWlpv1 BMP 179x143 179x143+0+0 PseudoClass
256c 1e+02kb
c.eps PS 179x143 179x143+0+0 PseudoClass 256c 1e+02kb
c.eps=>d.jpg PS 179x143 179x143+0+0 PseudoClass 8c 5kb
--> bad, oblique stripes
frontal01 533% conv
density=50
"gs" -q -dBATCH -dSAFER -dMaxBitmap=500000000 -dNOPAUSE -dAlignToPixels=0
"-sDEVICE=bmpsep8" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-g224x179"
"-r50x50" "-sOutputFile=/tmp/magick-XX40e61O" "-f/tmp/magick-XXPSP6Se"
"-f/tmp/magicfv35ap"/tmp/magick-XX40e61O[0] BMP 224x179 224x179+0+0 PseudoClass
256c 2e+02kb
/tmp/magick-XX40e61O[1] BMP 224x179 224x179+0+0 PseudoClass 256c 2e+02kb
/tmp/magick-XX40e61O[2] BMP 224x179 224x179+0+0 PseudoClass 256c 2e+02kb
/tmp/magick-XX40e61O[3] BMP 224x179 224x179+0+0 PseudoClass 256c 2e+02kb
c.eps PS 224x179 224x179+0+0 DirectClass 2e+02kb
c.eps=>d.jpg PS 224x179 224x179+0+0 PseudoClass 100=>98c 3/0.000000/0.016007db
2e+01kb
-->Good
(this is part of the displayed data on a web site describing activity at our computing center).
One conversion command is of the form (UNIX style):
convert -density ${DENSITY} -antialias -colors 128 \
-background white -normalize -units PixelsPerInch \
-quality 100 \
c.eps d.jpg
where ${DENSITY} used to be the number 100
Another set of thumbnail sized pictures is produced from the same original
eps files.
This stopped working when we switched to a more recent version of 'convert'.
We presently have:
Version: ImageMagick 6.2.5 12/18/06 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2005 ImageMagick Studio LLC
The convert program works well with some densities, and not with others.
Some tested values were:
DENSITY = 30, 50, 60, 80, 101, 105, 110 working fine
DENSITY = 20, 72, 90, 99, 100 not working
When convert fails, we get a picture of sparse oblique dotted lines, when
the original pictures are either color pie-charts or bar-charts.
My older version of "convert" still works fine on my SGI O2 machine,
at any density, and on the same files that fail with the newer 'convert'. The old version is
Version: @(#)ImageMagick 5.4.1 12/01/01 Q:16 http://www.imagemagick.org
Copyright: Copyright (C) 2001 ImageMagick Studio
But now I need to do the conversions on a SGI Altix (Itanium2 processors), under
Linux version 2.6.16.27-0.6-default (geeko@buildhost) (gcc version 4.1.0 (SUSE Linux)) #1 SMP Wed Dec 13 09:34:50 UTC 2006
I tried changing the density a little bit, just to get the program to work, but
some values worked with some files and not with others. All the EPSF files (there are two varieties)
are created by the same program (developed locally), and are DSC Conforming.
The conversion can be done successfully with the current version of convert
if I first convert from eps to pdf, then to jpg, but then
I loose the BoundingBox information that is necessary for correct cropping of the final
jpg image (recall: this has to be done automatically). Even if I could make this conversion path work
for this particular application, I would much prefer to continue doing the conversions
directly (eps -> jpg), otherwise a lot of script lines would need to be rewritten and checked.
And it is nicer to have reliability.
May be I am not aware of some recent change that may impose new resctrictions on
the input images; do the image dimensions have to be multiples of 8 pixel units in both directions,
for example, to better suit the output format? If Yes, is there an way to tell convert
to add the missing pixels for us, so that I may always get a viewable picture?
Here are sample outputs from a bad, then a good 'convert' run using the
above command and the same input file:
frontal01 532% conv
density=40
"gs" -q -dBATCH -dSAFER -dMaxBitmap=500000000 -dNOPAUSE -dAlignToPixels=0
"-sDEVICE=bmpsep8" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-g179x143"
"-r40x40" "-sOutputFile=/tmp/magick-XXXWlpv1" "-f/tmp/magick-XXWfkS2B"
"-f/tmp/magic0rMWXq"/tmp/magick-XXXWlpv1 BMP 179x143 179x143+0+0 PseudoClass
256c 1e+02kb
c.eps PS 179x143 179x143+0+0 PseudoClass 256c 1e+02kb
c.eps=>d.jpg PS 179x143 179x143+0+0 PseudoClass 8c 5kb
--> bad, oblique stripes
frontal01 533% conv
density=50
"gs" -q -dBATCH -dSAFER -dMaxBitmap=500000000 -dNOPAUSE -dAlignToPixels=0
"-sDEVICE=bmpsep8" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-g224x179"
"-r50x50" "-sOutputFile=/tmp/magick-XX40e61O" "-f/tmp/magick-XXPSP6Se"
"-f/tmp/magicfv35ap"/tmp/magick-XX40e61O[0] BMP 224x179 224x179+0+0 PseudoClass
256c 2e+02kb
/tmp/magick-XX40e61O[1] BMP 224x179 224x179+0+0 PseudoClass 256c 2e+02kb
/tmp/magick-XX40e61O[2] BMP 224x179 224x179+0+0 PseudoClass 256c 2e+02kb
/tmp/magick-XX40e61O[3] BMP 224x179 224x179+0+0 PseudoClass 256c 2e+02kb
c.eps PS 224x179 224x179+0+0 DirectClass 2e+02kb
c.eps=>d.jpg PS 224x179 224x179+0+0 PseudoClass 100=>98c 3/0.000000/0.016007db
2e+01kb
-->Good