# phpman > man > ppmtobmp(1)

> **TLDR:** Convert a PPM image to a BMP file.
>
- Convert a PPM image to a BMP file:
  `ppmtobmp {{path/to/file.ppm}} > {{path/to/file.bmp}}`
- Explicitly specify whether or not a Windows BMP file or an OS/2 BMP file should be created:
  `ppmtobmp -{{windows|os2}} {{path/to/file.ppm}} > {{path/to/file.bmp}}`
- Use a specific number of bits for each pixel:
  `ppmtobmp {{-b|-bbp}} {{1|4|8|24}} {{path/to/file.ppm}} > {{path/to/file.bmp}}`

*Source: tldr-pages*

---

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



## NAME
       ppmtobmp - convert a portable pixmap into a BMP file

## SYNOPSIS
       **ppmtobmp** [**-windows**] [**-os2**] [**-bpp=**_bits_per_pixel_] [_ppmfile_]

## DESCRIPTION
       Reads a portable pixmap as input.  Produces a Microsoft Windows or OS/2 BMP file as output.

## OPTIONS
       All  options can be abbreviated to their shortest unique prefix and you can use a double dash
       in place of the single dash, GNU-style.

### -windows
              Tells the program to produce a Microsoft Windows BMP file.  (This is the default.)

### -os2
              fault).

### -bpp
              8, and 24 are possible.  By default, **ppmtobmp** chooses the smallest number  with  which
              it can represent all the colors in the input image.  If you specify a number too small
              to represent all the colors in the input image, **ppmtobmp**  tells  you  and  terminates.
              You can use **ppmquant** or **ppmdither** to reduce the number of colors in the image.


## NOTES
       To get a faithful reproduction of the input image, the maxval of the input image must be 255.
       If it is something else, **ppmtobmp** the colors in the BMP file may be slightly  different  from
       the colors in the input.

       Windows icons are not BMP files.  Use **ppmtowinicon** to create those.


## SEE ALSO
       [**bmptoppm**(1)](https://www.chedong.com/phpMan.php/man/bmptoppm/1/markdown), [**ppmtowinicon**(1)](https://www.chedong.com/phpMan.php/man/ppmtowinicon/1/markdown), [**ppmquant**(1)](https://www.chedong.com/phpMan.php/man/ppmquant/1/markdown), [**ppmdither**(1)](https://www.chedong.com/phpMan.php/man/ppmdither/1/markdown), [**ppm**(5)](https://www.chedong.com/phpMan.php/man/ppm/5/markdown)


## AUTHOR
       Copyright (C) 1992 by David W. Sanderson.



                                            13 June 2000                                 [ppmtobmp(1)](https://www.chedong.com/phpMan.php/man/ppmtobmp/1/markdown)
