# anytopnm - convert an arbitrary type of image file to PBM, PGM, o... - man(1) - [phpMan]

> **TLDR:** Convert an arbitrary type of image file to common image formats.
>
- Convert an input image to PBM, PGM, or PPM format irrespective of the input type:
  `anytopnm {{path/to/input}} > {{path/to/output.pnm}}`
- Display version:
  `anytopnm {{-v|-version}}`

*Source: tldr-pages*

---

_Anytopnm_ _User_ [_Manual_(1)](https://www.chedong.com/phpMan.php/man/Manual/1/markdown)                General Commands Manual               _Anytopnm_ _User_ [_Manual_(1)](https://www.chedong.com/phpMan.php/man/Manual/1/markdown)

## NAME
       anytopnm - convert an arbitrary type of image file to PBM, PGM, or PPM


## SYNOPSIS
       **anytopnm **[_file_]



## DESCRIPTION
       This program is part of [**Netpbm**(1)](https://www.chedong.com/phpMan.php/man/Netpbm/1/markdown).

       **anytopnm **converts the input image, which may be in any of about 100 graphics formats, to PBM,
       PGM,  or  PPM format, depending on that nature of the input image, and outputs it to Standard
       Output.

       To determine the format of the input, **anytopnm **uses the **file **program  (possibly  assisted  by
       the  magic numbers file fragment included with Netpbm). If that fails (very few image formats
       have magic numbers), **anytopnm **looks at the  filename  extension.   If  that  fails,  **anytopnm**
       punts.

       The type of the output file depends on the input image.

       **anytopnm  **uses the converters for particular graphics formats that are in the Netpbm package,
       so it can't convert any format that you couldn't convert  with  some  other  Netpbm  program.
       What  **anytopnm  **adds is the ability to recognize the format and choose the appropriate Netpbm
       program to convert it.  For example, if you invoke **anytopnm **on a GIF file, **anytopnm **will rec‐
       ognize that it is a GIF file and therefore **giftopnm **knows how to convert it to PNM,  so  **any‐**
       **topnm **invokes **giftopnm**.

       **anytopnm **cannot recognize every possible input format, so you may still be able to convert an
       image with a specific Netpbm program when **anytopnm **fails to convert it.

       If  **file **indicates that the input file is compressed (either via Unix compress, gzip, or bzip
       compression), **anytopnm **uncompresses it and proceeds as above with the uncompressed result.

       If **file **indicates that the input file is encoded by uuencode or btoa, **anytopnm **decodes it and
       proceeds as above with the decoded result.

       If _file_ is **- **or not given, **anytopnm **takes its input from Standard Input.

       Many image formats are capable of representing multiple images.  In most cases, **anytopnm **con‐
       verts these to multi-image Netpbm images, but for some formats, **anytopnm  **converts  only  the
       first image and ignores the rest.

       In the case of a multi-image GIF input, **anytopnm **converts all the images starting with Netpbm
       10.69 (December 2014), but only the first in earlier releases.



## OPTIONS
       There are no command line options defined specifically for **anytopnm**.

       **anytopnm  **does not recognize the options common to all programs based on libnetpbm (See  Com‐
       mon Options .)  However, the **-version **option works.


## SEE ALSO
       [**pamfile**(1)](https://www.chedong.com/phpMan.php/man/pamfile/1/markdown), [**pnm**(1)](https://www.chedong.com/phpMan.php/man/pnm/1/markdown), **file **man page


## AUTHOR
       Copyright (C) 1991 by Jef Poskanzer.

## DOCUMENT SOURCE
       This manual page was generated by the Netpbm tool 'makeman' from  HTML  source.   The  master
       documentation is at

              **<http://netpbm.sourceforge.net/doc/anytopnm.html>**

netpbm documentation                      15 November 2014                   _Anytopnm_ _User_ [_Manual_(1)](https://www.chedong.com/phpMan.php/man/Manual/1/markdown)
