phpman > man > ppmtobmp(1)

Markdown | JSON | MCP    

TLDR: ppmtobmp (tldr-pages)

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}}
ppmtobmp(1)                            General Commands Manual                           ppmtobmp(1)



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   Tells the program to produce an OS/2 BMP file.  (Before August 2000, this was the  de‐
              fault).

       -bpp   This  determines how many bits per pixel you want the BMP file to contain.  Only 1, 4,
              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), ppmtowinicon(1), ppmquant(1), ppmdither(1), ppm(5)


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



                                            13 June 2000                                 ppmtobmp(1)

Generated by phpman local Author: Che Dong Under GNU General Public License
2026-06-15 04:19 @216.73.216.200
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 TransitionalValid CSS!