최근 글 목록
-
- 여러개의 파일에서 열을 추출
- 우분투
- 2010
-
- data column 잘라서 붙이기
- 우분투
- 2010
-
- subversion 간단하게 사용하...
- 우분투
- 2010
-
- ssh 접속시 시간 지연 해결..
- 우분투
- 2010
-
- 한글 사용법
- 우분투
- 2010
If you are a LaTex user like me you will instantly recognize what I’m getting at here. LaTex does not work well with most of the popular image formats such as JPG, BMP, PNG or GIF. It does like encapsulated postscript images though (EPS). So if you want nice figures in your papers you can either use tools that can generate eps files, or convert.
I usually just go straight to EPS – most of Linux based graphing tools have support for either than or straight postscript which is also perfectly fine for LaTex. Between OpenOffice.org, Gnuplot, and the charting tools in KOffice I rarely need to convert anything. But the other day I was doing a batch of screenshots of an application and the default output format was PNG.
How do you convert from PNG to EPS? There are lots of ways, but since I was on ubuntu, I opted for using sam2p. It’s a small application that converts raster images into bunch of different formats. You probably won’t find it in a default installation so just do:
apt-get install sam2p
Note that you need to have universe enabled in your apt sources. Once you install it, the rest is easy:
sam2p Screenshot-1.png EPS: Screenshot-1.eps
First argument is the source image, second is the desired format followed by a colon, and the third is the desired name of the output file. Easy as pie. The only slight disadvantage of doing this is that you pay a considerable size penalty for this conversion:
Screenshot-1.png: 6.4KB
Screenhsot-1.eps: 20.0 KB
But that’s to be expected – after all we are goinf from tight binary image format to a textual postscript monstrosity. Note that you can cat the EPS file you will see nice coded segments composed of only ASCII characters. If you try to do that to a PNG file, you will see garbled binary mess and hear the system bell sound off once or twice (encountering the ASCII code for system bell in the output).
최근 댓글 목록