Conversion between different image file formats

From Docswiki
Jump to navigation Jump to search

The convert command is an extremely powerful way of changing an image into a different format, or modifying it in ways you never thought possible! It is only available on workstations (as far as I can tell) so you'd first have to copy the file you wanted to copy there using scp.

For a full list of the possible options, type the following in a workstation shell:

convert -help

For example, to convert a .ppm file into a Postscript (.ps) file you could just use

convert image.ppm image.ps

There are some conversion tools installed on the clusters, and the best way to find them is simply to type the file extension you are converting from i.e. '.pdf' followed by '2' and then press TAB to display the possible options e.g.

pdf2 <TAB>

gives:

pdf2dsc  pdf2ps

which means we can use the tool pdf2ps to convert our '.pdf' file into a Postscript (.ps) file by using:

pdf2ps paper.pdf paper.ps

It is also worth trying the file extension followed by 'to' as well! This can be extremely useful when it comes to printing files.

dvi output from LaTeX can be converted to pdf or ps using:

dvips paper.dvi

or

dvipdf paper.dvi