Another route to convert a PS or EPS file (postscript) in png is to use ImageMagick, available on many operating systems. A single command is needed:
convert -density 300 file.ps file.png
The density parameter is the output resolution, expressed in dots per inch. With the standard 5×3.5in size of a gnuplot graph, this results in a 1500×1050 pixels PNG image. ImageMagick automatically applies antialiasing, so no post-processing is needed, making this technique especially suited to batch processing. The following Makefile automatically compiles all gnuplot files in a directory to EPS figures, converts them to PNG and then clears the intermediate EPS files. It assumes that all gnuplot files have a “.plt” extension and that they produce an EPS file with the same name, and the “.eps” extension:
GNUPLOT_FILES = $(wildcard *.plt) # create the target file list by substituting the extensions of the plt files FICHIERS_PNG = $(patsubst %.plt,%.png, $(GNUPLOT_FILES)) all: $(FICHIERS_PNG) %.eps: %.plt @ echo "compillation of "$< @gnuplot $< %.png: %.eps @echo "conversion in png format" @convert -density 300 $< $*.png @echo "end"
ps to eps is using command “ps2eps”
1) sudo apt-get install ps2eps
2) ps2eps -f inputfile
Export EPS from LaTeX
latex draw.tex; dvips draw.dvi -E -o draw.eps
What is EPS file format?
Encapsulated PostScript (EPS) is a standard file format for importing and exporting PostScript files. It is usually a single page PostScript program that describes an illustration or an entire page. The purpose of an EPS file is to be included in other pages. Sometimes EPS files are called EPSF files. EPSF simply stands for Encapsulated PostScript Format.
An EPS file can contain any combination of text, graphics and images. Since it is actually a PostScript file, it is one of the most versatile file formats that are available. EPS-files usually contain a small preview image that is used to visualize the content of the file.