PPMTOBMP(1)
π PPMTOBMP β the glow-up your PPM deserves π
okay bestie, so Ppmtobmp User Manual(1) β that's the whole General Commands Manual vibe β and she is iconic. Everybody say hi to ppmtobmp. π
β¨ NAME β¨
ppmtobmp β convert a PPM image into a BMP file π¦
β¨ SYNOPSIS β¨
ppmtobmp
[-windows]
[-os2]
[-bpp=bits_per_pixel]
[-mapfile=filename]
[ppmfile]
so like, a few housekeeping deets, no cap:
- Minimum unique abbreviation of an option is acceptable, she's flexible like that π
- You may use double hyphens instead of single hyphen to denote options
- You may use white space in place of the equals sign to separate an option name from its value
π« DESCRIPTION π«
This program is part of Netpbm(1). family reunion, everybody's here π
ppmtobmp reads a PPM image as input and produces a Microsoft Windows or OS/2 BMP file as output. literally that's it, that's the whole job, and she ate π₯
β¨ OPTIONS β¨
on top of the options common to all programs based on libnetpbm (most notably -quiet, see Common Options), ppmtobmp recognizes these command line options:
-windowsβ tells the program to produce a Microsoft Windows BMP file. this one is the default, she's the main character π-os2β tells the program to produce an OS/2 BMP file. before August 2000, this was the default. throwback era fr fr π°οΈ-bppβ this tells how many bits per pixel you want the BMP file to contain. only1,4,8, and24are possible, that's the whole menu bestie π by default,ppmtobmpchooses 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,ppmtobmptells you and terminates. you can usepnmquantorppmditherto reduce the number of colors in the image. before Netpbm 10.85 (December 2018),ppmtobmpignores this option if the input is PBM and produces a BMP with 1 bit per pixel. with these versions, if you want more than that, usepbmtopgmto convert the PBM to PGM first.-mapfile=filenameβ this identifies a file to use as the BMP palette (aka "colormap"). in one BMP subformat, the BMP stream contains a palette of up to 256 colors, and represents the image raster as indices into that palette. normally,ppmtobmptakes care of computing a suitable palette, but if you are going to dissect the BMP output in some way, you may want certain values for the palette indices. e.g. you might want red to be 13, whereppmtobmpwould (arbitrarily) choose 39. in that case, you can construct the palette yourself and use this option to tellppmtobmpto use your palette. this option does not control what colors are in the output. the colors in the output are exactly those in the input, and the palette you supply must contain at least all the colors that are in the input. you can usepnmremapto adjust your input image so that it contains only colors from your palette. the palette file is a Netpbm format file with one pixel per palette entry. each pixel must have a distinct color (no repeats). the order of the BMP paletteppmtobmpgenerates is the order of the pixels in the palette file, going from top to bottom, left to right. a BMP palette may have at most 256 colors, so the palette file must have at most 256 pixels. you may findpnmcolormapuseful in generating the palette file.pamseqtoo. in the case of grayscale image, if you are processing the BMP image, it may be convenient for you to have the actual gray values in the raster part of the image rather than arbitrary indices into a palette. there is no BMP format specifically for that, but you can achieve it by using a palette in which each index is equal to the indexed gray value, and then ignoring the palette when you process the BMP image. here is an example of doing that:
$ pamseq 1 255 > mapfile.pgm
$ ppmtobmp -mapfile=mapfile.pgm input.pgm > output.bmp
this option was new in Netpbm 10.45 (December 2008). babygirl is a Scorpio probably π¦
πΈ NOTES πΈ
to get a faithful reproduction of the input image, the maxval of the input image must be 255. if it is something else, the colors in the BMP file may be slightly different from the colors in the input. not a scam, just math π
Windows icons are not BMP files. use ppmtowinicon to create those. don't be out here converting wrong, i'm begging π
π SEE ALSO π
π§ AUTHOR π§
Copyright (C) 1992 by David W. Sanderson. legend behavior, we stan π
π 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/ppmtobmp.html
okay that's the whole thing bestie, go forth and convert π and hey β this was netpbm documentation, dated 20 December 2018, and it's literally called the Ppmtobmp User Manual(1). periodt. π
β¨π«Ά
π¦ where this page comes from
- debian bookworm: netpbm 2:11.01.00-2 Β· MIT
- debian trixie: netpbm 2:11.10.02-1 Β· MIT
- ubuntu noble: netpbm 2:11.05.02-1.1build1 Β· MIT
- ubuntu resolute: netpbm 2:11.10.02-1build1 Β· MIT
- ubuntu stonking: netpbm 2:11.13.03+ds-2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms