Conversion Toolsepstopdf doesn't maintain image quality? (MacTeX)

Information and discussion about output converters related to LaTeX (e.g. dvips, ps2pdf, ...)
Post Reply
tigerotor77w
Posts: 6
Joined: Fri Feb 05, 2010 7:35 pm

epstopdf doesn't maintain image quality? (MacTeX)

Post by tigerotor77w »

Forgive me if I use improper terminology here. I was planning to use .pdf files for images (overview: Matlab generates .eps files, which I then convert to .pdf with eps2pdf). Most of the images convert fine, but there are some files that simply do not convert well at all, and I'm not sure why. A friend was able to convert successfully to .pdf, but I can't mine to work correctly (for this file). I've uploaded both the original .eps file -- large download -- and the converted .pdf in hopes that someone may have a suggestion as for what to do.

http://netfiles.uiuc.edu/xwang22/Public ... avelet.eps
http://netfiles.uiuc.edu/xwang22/Public ... avelet.pdf

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: epstopdf doesn't maintain image quality? (MacTeX)

Post by frabjous »

Could you create a smaller sample to test with? I'm not downloading a 25 MB .eps file to experiment with. That would be very inefficient.
tigerotor77w
Posts: 6
Joined: Fri Feb 05, 2010 7:35 pm

Re: epstopdf doesn't maintain image quality? (MacTeX)

Post by tigerotor77w »

Unfortunately, the only .eps files that don't convert correctly on my machine are the larger ones. :(
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

epstopdf doesn't maintain image quality? (MacTeX)

Post by localghost »

The problem of your PDF file is that it is the result of a conversion with low resolution. I got the EPS file from the source you gave and converted it manually with ps2pdf on the command line.

Code: Select all

ps2pdf -r600 young_mirror_lowavelet.eps young_mirror_lowavelet.pdf
Afterwards you have to crop the PDF by using the Perl script pdfcrop. This will require an installed Perl interpreter [1]. The final result is attached.

Supplement:
I also managed to convert the file with epstopdf on the command line.

Code: Select all

epstopdf --gsopt=-r600 young_mirror_lowavelet.eps
Somehow the program didn't seem to stop. But the result was OK. The advantage is that the output needs no subsequent cropping.

[1] The Dynamic Languages Company: Perl, Python and Tcl - ActiveState


Best reqards
Thorsten
Attachments
young_mirror_lowavelet-crop.pdf
The final result after processing the EPS file.
(25.63 KiB) Downloaded 509 times
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
tigerotor77w
Posts: 6
Joined: Fri Feb 05, 2010 7:35 pm

epstopdf doesn't maintain image quality? (MacTeX)

Post by tigerotor77w »

Thanks for the reply! The pstopdf command does generate a pdf of "correct" resolution, but on a Mac, the command you provided --

Code: Select all

epstopdf --gsopt=-r600 young_mirror_lowavelet.eps
is not recognized. I tried instead

Code: Select all

epstopdf --res=600 young_mirror_lowavelet.eps
,
but this doesn't change the output from the default. The options that I see are:

Code: Select all

Usage: epstopdf [OPTION]... [EPSFILE]

Convert EPS to PDF, by default using Ghostscript.

Options:
  --help             display this help and exit
  --version          display version information and exit
 
  --outfile=FILE     write result to FILE
  --(no)compress     use compression       (default: true)
  --(no)debug        write debugging info  (default: false)
  --(no)embed        embed fonts           (default: true)
  --(no)exact        scan ExactBoundingBox (default: false)
  --(no)filter       read standard input   (default: false)
  --(no)gs           run ghostscript       (default: true)
  --(no)hires        scan HiResBoundingBox (default: false)
  --gscmd=VAL        pipe output to VAL    (default: gs)
  --res=DPI          set image resolution  (default: [use gs default])
  --autorotate=VAL   set AutoRotatePages   (default: None)
                      Recognized VAL choices: None, All, PageByPage
                      For EPS files, PageByPage is equivalent to All
  --restricted       use restricted mode   (default: false)

Examples for producing 'test.pdf':
  * epstopdf test.eps
  * produce postscript | epstopdf --filter >test.pdf
  * produce postscript | epstopdf -f -d -o=test.pdf

Example: look for HiResBoundingBox and produce corrected PostScript
  * epstopdf -d --nogs --hires test.ps >testcorr.ps
Am I using the correct syntax in the options?
User avatar
T3.
Posts: 208
Joined: Fri Mar 14, 2008 12:58 pm

epstopdf doesn't maintain image quality? (MacTeX)

Post by T3. »

Don't bother with eps to pdf conversion and instead produce pdf directly from MATLAB:

http://www.mathworks.com/matlabcentral/ ... ange/16179

Cheers,

Tomek
tigerotor77w
Posts: 6
Joined: Fri Feb 05, 2010 7:35 pm

Re: epstopdf doesn't maintain image quality? (MacTeX)

Post by tigerotor77w »

Hum, interesting -- thanks for that snippet!

I was playing around earlier this morning and noticed that "--noembed" seems to help with those figures (that is, ones similar to the .eps file I attached) as well. Either way, thanks for the Matlab tip -- it'll save one step in the data processing chain. :)
Post Reply