4

I am using Linux. I want to convert an eps file to jpeg file. I find that I can use "convert" command. However, the resulting image looks very small. I want to enlarge the jpeg file by -resize option. It seems not to work. The resulting image is a pure black one. Does anyone have the same problem?

Here are more details:

  1. If I use:

    convert -scale 1000x1000 your.eps your.jpg
    

    The resulting image looks like a low quality image. The eps vector image is not scaled properly.

  2. If I use:

    convert -geometry 300% your.eps your.jpg
    

    I get a pure black image.

Here is my phf file:

2shared.com/document/RXl2Be-g/askquestions.html

and my eps file:

2shared.com/file/qrmwKegj/askquestions.html

Gaff
  • 18,569
  • 15
  • 57
  • 68
Anand
  • 141
  • 1
  • 3

4 Answers4

1

Updated: This should work (-flatten did the trick for me)

convert -geometry 110% your.eps -flatten your.jpg
aioobe
  • 274
  • 1
  • 18
  • I did that. But the resulting image looks very bad. It seems not properly scaled. Since eps file is a vector image, it should be able to scale very well. –  Sep 15 '10 at 08:11
  • My test-eps file scales just fine. Care to upload your eps somewhere? – aioobe Sep 15 '10 at 08:13
  • it still doesn't work with -resample 100. Sorry :-( –  Sep 15 '10 at 08:24
  • Could you upload your eps somewhere? – aioobe Sep 15 '10 at 08:25
  • I want to upload somewhere. Do you have any recommendations on where I can upload? Thank you Aioobe. :-) –  Sep 15 '10 at 08:37
  • Here is my eps file: http://www.2shared.com/file/qrmwKegj/askquestions.html –  Sep 15 '10 at 08:40
  • @Anand -flatten did the trick it seems! – aioobe Sep 15 '10 at 08:41
  • Ok, that file is not vector-graphics. It's some sort of embedded bitmap. – aioobe Sep 15 '10 at 08:43
  • @Aioobe, it looks better, but still not very satisfactory. –  Sep 15 '10 at 08:43
  • Okay. I see the problem. I use latex to generate pdf file and then use epstool to convert it to eps file. –  Sep 15 '10 at 08:45
  • Try converting the PDF file directly to a jpeg image, using either convert or gs :) – gnud Sep 15 '10 at 08:46
  • Here is my pdf file: http://www.2shared.com/document/RXl2Be-g/askquestions.html It seems not work well. :-( –  Sep 15 '10 at 08:50
  • I find a solution, but it is by far the optimal. I create an empty latex file with only one line: \includegraphics[scale=2]{askquestions} In this case, the image scales well. –  Sep 15 '10 at 08:53
  • I find the correct option is -density: convert -density 400 file.pdf -scale 2000x1000 file.jpg –  Sep 15 '10 at 09:17
1

Inkscape can convert Encapsulated PostScript into PNG data:

inkscape -D -e "$OUPUT_PNG" -h "$HEIGHT_PX" -w "$WIDTH_PX" "$INPUT_EPS"
amphetamachine
  • 1,668
  • 2
  • 12
  • 15
  • Thanks Amphetamachine, I tried. But it doesn't work. Here is my file: http://www.2shared.com/file/qrmwKegj/askquestions.html –  Sep 15 '10 at 08:47
  • Inkscape is the only thing that worked for me, as follows: 1) `inkscape myfile.eps`. 2) File > Export PNG Image... 3) Convert PNG to JPG via `convert image.png -background white -flatten -alpha off image.jpg` – sh37211 Dec 01 '21 at 05:14
1

I would use ghostscript:

gs -dNOPAUSE -r300 -sDEVICE=jpeg -sOutputFile=<output.jpg> <input.eps>
Curd
  • 121
  • 2
  • Thanks Curd, it generate an A4 page with large margins. If I trimmed them off, it becomes again a small image. –  Sep 15 '10 at 08:46
1

You have to set desired resolution (in dpi) before reading a file, for example:

convert -density 600x600 your.eps -quality 85 your.jpg

If you need to resize it to particular resolution then read in high density and then resize:

convert -density 1200x1200 your.eps -scale 1000x1000 -quality 85 your.jpg
Tometzky
  • 486
  • 3
  • 15