Page 1 of 1
background black instead of white for EPS->JPG
Posted: 2010-08-04T11:19:44-07:00
by nycynik
Hi-
I am converting EPS images to JPGs, and I have two machines that I work with, one converts fine, the second leaves the background black instead of white. I use the same command on both to convert the image, and have tried adding -transparency and -background, but it is still black instead of white. I know it has something to do with the clipping path, but I do not know how to solve it. I upgraded ghostscript on the computer that does not work also, not sure if that was an issue, but it has not helped.
Code: Select all
convert.exe -colorspace RGB -profile sRGB.icc -resize 120 -quality 100 -density 300 -antialias -transparency white -background white -normalize -units PixelsPerInch -quality 100 original.eps original_120x120.jpg
GS 8.71 and ImageMagick 6.3.3
Anything I can try would be great, thanks!
Mike
Re: background black instead of white for EPS->JPG
Posted: 2010-08-04T11:24:50-07:00
by nycynik
btw - i read about the -clip; but it does not have any effect.
viewtopic.php?f=1&t=16750
Re: background black instead of white for EPS->JPG
Posted: 2010-08-04T11:25:33-07:00
by immortal26
to me it looks like you are setting the transparency color to white... and you are setting background color to white... which in turn will cause you to have a transparent background all together, giving you a black background from it being a JPG image.
remove the -transparency white from your command and see what happens.
Re: background black instead of white for EPS->JPG
Posted: 2010-08-04T11:34:56-07:00
by nycynik
thanks for the help.
Removed transparency, and have the same problem.
Re: background black instead of white for EPS->JPG
Posted: 2010-08-04T11:35:36-07:00
by nycynik
I also checked delegates, and they match.
Code: Select all
eps<=>ps "C:/Program Files/gs/gs8.54/bin/gswin32c.exe" -q -dBATCH -d
SAFER -dMaxBitmap=500000000 -dNOPAUSE -dEPSCrop -dAlignToPixels=0 -sDEVICE=pswri
te "-sOutputFile=%o" -- "%i"
eps<=>pdf "C:/Program Files/gs/gs8.54/bin/gswin32c.exe" -q -dBATCH -d
SAFER -dMaxBitmap=500000000 -dNOPAUSE -dEPSCrop -dAlignToPixels=0 -sDEVICE=pdfwr
ite "-sOutputFile=%o" -- "%i"
still looking around.
Re: background black instead of white for EPS->JPG
Posted: 2010-08-04T11:55:45-07:00
by nycynik
Installed and tried to view the images with ghostview - and they work perfectly, so it's not the upgraded ghostview (I no longer think), so it must be soemthing with the jpg.
Re: background black instead of white for EPS->JPG
Posted: 2010-08-04T12:02:07-07:00
by immortal26
If you want you can pm me the eps file and I can see what I come up with.
Re: background black instead of white for EPS->JPG
Posted: 2010-08-04T12:32:42-07:00
by nycynik
I solved the probem (kind of) by removing the -colorspace RGB option.
I am not sure why this fixed anything, but it worked. I started adding colorspace RGB to fix the issue I had when converting TIFF images that were CMYK.
So.. I am going to leave the option in for TIFF, and take it out for EPS.
Thanks for your help
Mike
Re: background black instead of white for EPS->JPG
Posted: 2010-08-04T19:40:27-07:00
by Drarakel
Part of the problem here was that your command line order is not quite right.
See here:
http://www.imagemagick.org/Usage/basics/#cmdline
When you're using "convert -colorspace RGB input.tiff output.jpg", then it will still work, as ImageMagick will use it like that: "convert input.tiff -colorspace RGB output.jpg" But it's better to specify it like that (first the input image, then the options, then the output image) right at the start.
And you might generate problems when you're using something like "convert -colorspace RGB input.eps output.jpg", because for EPS/AI/PDF/PS files, a "-colorspace" option before the input file is something different compared to a "-colorspace" option after the input file. When used after the input file, ImageMagick will first read the image (with Ghostscript), and after that convert it to RGB. But in the other case, the "-colorspace RGB" changes the way how ImageMagick/Ghostscript reads the image. So, in your example, you're getting transparency right at the start.
You can fix it by either leaving out "-colorspace RGB" (and of course leaving out "-transparent white"), or by adding "-background white -flatten" as last operation. But you can also fix it by changing your command line order like that for EPS files:
Code: Select all
convert.exe -density 300 original.eps -colorspace RGB -resize 120 -normalize -units PixelsPerInch -quality 100 original_120x120.jpg
Re: background black instead of white for EPS->JPG
Posted: 2010-08-04T20:21:05-07:00
by nycynik
wow, ok i wish that was not labeled Basics.
That worked great! I did not realize that the order mattered in these cases; I thought it was just source destination with options.
This is great, thanks!
Mike