Tag: image
Graphics format conversion
by Mostafa on Dec.09, 2009, under LaTeX, Linux, Software
Up until now I have been using the ‘convert‘ tool that comes with ImageMagick to switch between image formats — mainly for creating EPS files from JPG/PNG (raster format) files for use with LaTeX. Then I came across sam2p.
It is a light-weight utility that does one thing only and it does it well: convert between image formats. I’ve been using it for a while now and find that it can greatly reduce files sizes with minimal drop in quality. I’ve even used it to process existing EPS files just to get the reduction in file size. Best of all, it is multi-platform — executables are available for both Windows and Linux on the project homepage.
Goodbye convert and hello sam2p!
Logo in a LaTeX document header/footer
by Mostafa on Oct.22, 2007, under How To ..., LaTeX
Easily accomplished using the ‘fancyhdr‘ package:
\usepackage{fancyhdr} \renewcommand{\headheight}{0.6in} \setlength{\headwidth}{\textwidth} \fancyhead[L]{}% empty left \fancyhead[R]{ % right \includegraphics[height=0.53in]{img-file} } \pagestyle{fancy}
All of that goes into the preamble of the document.
Mass conversion of images
by Mostafa on May.07, 2007, under How To ..., LaTeX, Linux, Software
The following “one-liner” can be used to mass convert a given image format into another using the convert (part of ImageMagick) and basename tools:
$ for A in $(ls *.$SRC_TYPE); do convert $A $(basename $A .$SRC_TYPE).$DST_TYPE; done
where $SRC_TYPE is the file suffix of the original images (e.g. png) and $DST_TYPE is the file suffix of the type desired (e.g. eps).
PSfrag for EPS Graphichs Text Manipulation
by Mostafa on Jan.17, 2006, under How To ..., LaTeX, Software
There’s a nice package called psfrag that allows you to insert LaTeX constructs into EPS figures. This is specially useful with EPS files saved from MATLAB plots. The way it works is by replacing a given tag in the text of the EPS file with the LaTeX construct.
E.g. label the x-axis of of the plot as XLABEL and save the plot as an EPS file. Then, when you include that file, just put in the \psfrag{}{} tag:
\psfrag{XLABEL}{$\frac{\tau}{\sigma}$}
\includegraphics{file}
The most obvious disadvantage is that it only works with EPS figures — so no PdfLaTeX. So, to compile a document to PDF, you’ll need to go the old latex -> dvi2ps -> ps2pdf way.
More details can be found on CTAN.
Inkscape
by Mostafa on Sep.17, 2005, under Art, Software
I installed Inkscape a few days ago out of pure curiosity. Today I’m glad that I did .. I needed to touch up some diagrams with a few translucent windows here and there and GIMP didn’t seem to have any easy of doing it. So came the first field test of Inkscape ..
It works quite well – at least from the first impression. I can already see it giving MS Visio a run for its money …