EPS to GIF quality

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?".
hendrickst
Posts: 11
Joined: 2011-04-06T07:47:00-07:00
Authentication code: 8675308

EPS to GIF quality

Post by hendrickst »

I am attempting to convert simple black and white eps files. The files are line drawings with a 1/2 point thickness. When a line goes at an angle, the line becomes very jagged.

First, most of my problem is that quality that I am forced to use. The request is for 315x145 pixels at a 72dpi res. I also must incorporate a transparent background and change the black lines to a RGB 56,56,56 grey value.

My current conversion line is below. Is there anyway to improve the appearance of angled lines?

Code: Select all

convert sample.eps -fuzz 5% -transparent white -fill rgb(56,56,56) -opaque black sample.gif
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: EPS to GIF quality

Post by fmw42 »

use supersampling or just a larger density. EPS and other vector formats do not have a native size, that is set by the density.

If one assumes a default density of 72 dpi, then try 4*72=288

convert -density 288 image.eps -resize 25% .... your other commands ... result.gif

or perhaps put the -resize at the end before the result image


convert -density 288 image.eps .... your other commands ... -resize 25% result.gif


Not this will be slower, but give better quality. If you want a larger output, just increase the density value or just get rid of the -resize.
hendrickst
Posts: 11
Joined: 2011-04-06T07:47:00-07:00
Authentication code: 8675308

Re: EPS to GIF quality

Post by hendrickst »

I'm still appears that I'm doing something wrong. I'm not seeing a difference in output by simply including the -density operator.

Code: Select all

convert source.eps before.gif
Using

Code: Select all

identify -verbose
I get the following.

Image: no_resize.gif
Format: GIF (CompuServe graphics interchange format)
Class: PseudoClass
Geometry: 315x145+0+0
Resolution: 72x72
Print size: 4.375x2.01389
Units: Undefined
Type: Grayscale
Base type: Grayscale
Endianess: Undefined
Colorspace: RGB
Depth: 8-bit
Channel depth:
gray: 8-bit
Rendering intent: Undefined
Interlace: None
Background color: rgb(254,254,254)
Border color: rgb(223,223,223)
Matte color: grey74
Transparent color: black
Compose: Over
Page geometry: 315x145+0+0
Dispose: Undefined
Compression: LZW
Orientation: Undefined
Properties:
date:create: 2011-04-06T15:56:33-05:00
date:modify: 2011-04-06T15:56:33-05:00
signature: ab3ce3a9a96c2749d461dce31a1d20b42583111ff452d9cdcf6d90b2eee1e136
Artifacts:
verbose: true
Tainted: False
Filesize: 1.76KBB
Number pixels: 45.7KB
Pixels per second: 3.045MB
User time: 0.016u
Elapsed time: 0:01.015
Version: ImageMagick 6.6.9-2 2011-03-31 Q8 http://www.imagemagick.org

Code: Select all

convert -density 288 source.eps no_resize.gif
Image: density_288.gif
Format: GIF (CompuServe graphics interchange format)
Class: PseudoClass
Geometry: 315x145+0+0
Resolution: 72x72
Print size: 4.375x2.01389
Units: Undefined
Type: Grayscale
Base type: Grayscale
Endianess: Undefined
Colorspace: RGB
Depth: 8-bit
Channel depth:
gray: 8-bit
Rendering intent: Undefined
Interlace: None
Background color: rgb(254,254,254)
Border color: rgb(223,223,223)
Matte color: grey74
Transparent color: black
Compose: Over
Page geometry: 315x145+0+0
Dispose: Undefined
Compression: LZW
Orientation: Undefined
Properties:
date:create: 2011-04-06T15:59:39-05:00
date:modify: 2011-04-06T15:59:39-05:00
signature: ab3ce3a9a96c2749d461dce31a1d20b42583111ff452d9cdcf6d90b2eee1e136
Artifacts:
verbose: true
Tainted: False
Filesize: 1.76KBB
Number pixels: 45.7KB
Pixels per second: 45.675GB
User time: 0.000u
Elapsed time: 0:01.000
Version: ImageMagick 6.6.9-2 2011-03-31 Q8 http://www.imagemagick.org
hendrickst
Posts: 11
Joined: 2011-04-06T07:47:00-07:00
Authentication code: 8675308

Re: EPS to GIF quality

Post by hendrickst »

I think the problem with density not working was the source eps file. I converted straight to an svg and then used your method and it did resize. Original problem still remains however. Any line that is an angle is very jagged.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: EPS to GIF quality

Post by fmw42 »

can you post a link to your eps image so others can examine it and try ourselves to convert it?

Have you said what platform you are on and what version of delegate libraries you are using (ghostscript)?

Are you doing identify -verbose on the correct images? The names do not match your command lines!
hendrickst
Posts: 11
Joined: 2011-04-06T07:47:00-07:00
Authentication code: 8675308

Re: EPS to GIF quality

Post by hendrickst »

1) I don't have an external web site to put the file on. If someone could post it I'd be happy to E-mail it.

2) Windows XP platform.

Results of convert -version:
Version: ImageMagick 6.6.9-2 2011-03-31 Q8 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP

3) In regards to identify -verbose, yes, they are the right files. The names I'm using with are odd so I've cleaned up the line to remove the name. When doing the identify command only one gif file exists in the folder (specifically to avoid the issue you mentioned).
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: EPS to GIF quality

Post by fmw42 »

there are a number of free image hosting web sites. you could try there. that would be the best first approach. search Google for free image hosting or something like that. Then once you get the image hosted, you can put a link in your message to its url for downloading.
hendrickst
Posts: 11
Joined: 2011-04-06T07:47:00-07:00
Authentication code: 8675308

Re: EPS to GIF quality

Post by hendrickst »

Took a bit to find one that allowed EPS files. Below is a sample of the eps.

EPS: http://www.mediafire.com/?j9db7dzn69x2lvx
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: EPS to GIF quality

Post by fmw42 »

I downloaded your eps file and attempted the following, but got errors. I am not enough of an expert on vector formats nor if my computer has correctly configured its delegates to know what is the issue. Sorry. It appears to have some imbedded lab.icc profile which it cannot find on my system


convert -density 288 Sample.eps -resize 25% Sample.gif
Unrecoverable error: rangecheck in .putdeviceprops
sfopen: gs_parse_file_name failed.
sfopen: gs_parse_file_name failed.
./base/gsicc_manage.c:706: gsicc_open_search(): Could not find lab.icc
| ./psi/zusparam.c:805: set_lab_icc(): cannot find default lab icc profile
Unrecoverable error: rangecheck in .putdeviceprops
sfopen: gs_parse_file_name failed.
sfopen: gs_parse_file_name failed.
./base/gsicc_manage.c:706: gsicc_open_search(): Could not find lab.icc
| ./psi/zusparam.c:805: set_lab_icc(): cannot find default lab icc profile
convert: Postscript delegate failed `Sample.eps': No such file or directory @ error/ps.c/ReadPSImage/806.
convert: missing an image filename `Sample.gif' @ error/convert.c/ConvertImageCommand/3011.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: EPS to GIF quality

Post by anthony »

The EPS files works on my machine, but has nothing visible on the page!


As an alternative that may be easier to handle try http://www.dropbox.com

I use it now for all my image hosting for this mail list, though I only upload via the web interface (and a script I found to make it easy). I don't use one of their 'sync with local directory', though I can see that being handy as a method of sync files between multiple computers.

I'll send you an invite. If you accept we both get more space!
or jump to http://db.tt/Y4cW7DS

PS; I could use a little more space
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
hendrickst
Posts: 11
Joined: 2011-04-06T07:47:00-07:00
Authentication code: 8675308

Re: EPS to GIF quality

Post by hendrickst »

Tried to use DropBox, but security is preventing. I did create a login so you may get your storage space increase.

In regards to the file, I rushed to get it done before a meeting and forgot an export setting that creates the eps. I've corrected (and double checked) that the art is there. Same link should still work.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: EPS to GIF quality

Post by fmw42 »

This worked just fine for me now with your new download from mediafire.

convert -density 288 Sample.eps -resize 25% Sample.gif

No error and your graphics show fine compared to a pdf version that my system created automatically from the eps.

I am on IM 6.6.9.4 Q16 Mac OSX tiger, and I believe GS 9
hendrickst
Posts: 11
Joined: 2011-04-06T07:47:00-07:00
Authentication code: 8675308

Re: EPS to GIF quality

Post by hendrickst »

Still not there. I'm going to work on it more tomorrow, but I see that using your density/resize approach, as well as my original, does not maintain line thicknesses. They all appear to be the same thickness. If you reference the EPS, the art should be a .5point while the lines marked with a W/H/L are .25pt. In the end result however you can not see a difference.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: EPS to GIF quality

Post by fmw42 »

If you want broader lines, then increase the density or increase the -resize percentage or take out the -resize
hendrickst
Posts: 11
Joined: 2011-04-06T07:47:00-07:00
Authentication code: 8675308

Re: EPS to GIF quality

Post by hendrickst »

I don't think I was clear. I need the lines to come over in the same ratio as they are in the EPS. Basically, the EPS has two line thicknesses, but the GIF appears to translate them all to one thickness. Below is the complete cmd line I'm using. Not sure where the problem is coming from.

Code: Select all

Convert ephemeral[Source file] -fuzz 5% -transparent white -fill rgb(56,56,56) -opaque black [Destination file]
Post Reply