Tips for improving EPS -> JPG conversion

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
stevenb46
Posts: 40
Joined: 2014-08-20T08:47:18-07:00
Authentication code: 6789

Tips for improving EPS -> JPG conversion

Post by stevenb46 »

I've set quality to 100, done a density 1000 and then a resize 10%:

convert -density 1000 "file.eps" -quality 100 -resize 10% "file.jpg"

is there anything else I can do to improve the clarity of the jpg?

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

Re: Tips for improving EPS -> JPG conversion

Post by fmw42 »

Probably should put -quality after the resize, but it likely won't matter.

You can also control the sampling-factor. See http://www.imagemagick.org/script/comma ... ing-factor. But I really do not know if that will change much or not.

You can also use a custom compression table (not sure of the terminology), but I am not an expert on this and do not how you would go about it.

Be sure you are using the latest libjpeg, also

Be sure your Ghostscript delegate is up to date.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Tips for improving EPS -> JPG conversion

Post by snibgo »

stevenb46 wrote:is there anything else I can do to improve the clarity of the jpg?
If you upload the eps file to somewhere like dropbox.com and paste the URL here, we can be more specific.

Is the input vector or raster? If raster, it is generally better to use the "correct" density, rather than supersampling. If vector, supersampling may reduce clarity. For example, lines might be defined as one pixel wide so "-resize 10%" will make them almost invisible.
snibgo's IM pages: im.snibgo.com
stevenb46
Posts: 40
Joined: 2014-08-20T08:47:18-07:00
Authentication code: 6789

Re: Tips for improving EPS -> JPG conversion

Post by stevenb46 »

we are looking for something that will generally work for all eps images. The eps is from AI, so its vector, though some come from Photoshop. Using default settings in IM, makes the jpg cloudy, blurry, I found out a long time ago, that super sampling like I do here really improves the jpg. I'm just looking for the best output possible.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Tips for improving EPS -> JPG conversion

Post by snibgo »

Have you tried a different file format? Jpeg will mangle colours from vector images, and can create larger files then png.
snibgo's IM pages: im.snibgo.com
stevenb46
Posts: 40
Joined: 2014-08-20T08:47:18-07:00
Authentication code: 6789

Re: Tips for improving EPS -> JPG conversion

Post by stevenb46 »

No, jpg is required output. There's no choice. I have noticed that blues are darker coming out of IM, as compared to jpgs coming out of Photoshop and we would like a closer representation. I'd like that corrected as well.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Tips for improving EPS -> JPG conversion

Post by fmw42 »

Photoshop probably assigns an AdobeRGB profile. IM will not assign one unless you specify and typically interprets the image as sRGB. Check your Photoshop to see if it is assigning a profile and use -profile in IM to assign the same profile at the end of your processing. I do not know if eps carries a profile or not.
stevenb46
Posts: 40
Joined: 2014-08-20T08:47:18-07:00
Authentication code: 6789

Re: Tips for improving EPS -> JPG conversion

Post by stevenb46 »

Just found out that a complaint is that the jpg is in cmyk, and should be in rgb. How do I convert this? Is it as simple as:

convert -colorspace cmyk "file.eps" -colorspace sRGB "file.jpg"

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

Re: Tips for improving EPS -> JPG conversion

Post by fmw42 »

stevenb46 wrote:Just found out that a complaint is that the jpg is in cmyk, and should be in rgb. How do I convert this? Is it as simple as:

convert -colorspace cmyk "file.eps" -colorspace sRGB "file.jpg"

Thanks again.
convert -colorspace sRGB "file.eps" "file.jpg"

or you can use profiles after reading the eps file. But you need to know if the eps file has a profile or not, since the syntax is different. see
http://www.imagemagick.org/Usage/formats/#profiles
stevenb46
Posts: 40
Joined: 2014-08-20T08:47:18-07:00
Authentication code: 6789

Re: Tips for improving EPS -> JPG conversion

Post by stevenb46 »

ok, thanks, not sure of this:

Photoshop profile:
Profiles:
Profile-8bim: 2726 bytes

IM profile:
Profiles:
Profile-xmp: 26666 bytes

Does this make a difference? If so, how do I use that instead?

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

Re: Tips for improving EPS -> JPG conversion

Post by fmw42 »

Neither are color profiles. They would be either icc or icm.

So if you want to convert from cmyk to sRGB or some other RGB profile such as AdobeRGB, you can either do:

Code: Select all

convert -colorspace sRGB "file.eps" "file.jpg"
or if no icc or icm profile and you know the input is cmyk, then

Code: Select all

convert "file.eps" -profile /path2/USWebCoatedSWOP.icc -profile /path2/sRGB.icc "file.jpg"
If there is an icc or icm profile in the eps file, then

Code: Select all

convert "file.eps" -profile /path2/sRGB.icc "file.jpg"
stevenb46
Posts: 40
Joined: 2014-08-20T08:47:18-07:00
Authentication code: 6789

Re: Tips for improving EPS -> JPG conversion

Post by stevenb46 »

I don't know how to tell what profile was used. How would I be able to tell? Images have gotten much worse compared to JPG from Photoshop.

convert -density 96 -colorspace CMYK "g65f75-Map.eps" -antialias -colorspace sRGB -quality 100 -units PixelsPerInch "g65f75-Map.jpg"

Images from IM are no longer as clean. Colors are much brighter than Photoshop and edges are not smooth. HELP!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Tips for improving EPS -> JPG conversion

Post by fmw42 »

convert -density 96 -colorspace CMYK "g65f75-Map.eps" -antialias -colorspace sRGB -quality 100 -units PixelsPerInch "g65f75-Map.jpg
This is not what I said to do in my earlier post. You must put -colorspace sRGB before reading the eps file, because it is a vector file.

Try this

Code: Select all

convert -density 96 -units PixelsPerInch -colorspace sRGB "g65f75-Map.eps" -quality 100  "g65f75-Map.jpg
If this does not work, then post your eps file to dropbox.com and put the URL to it here, so we can test ourselves with your image. Also post your Photoshop result and what PS steps you use to create it.
Post Reply