LIBNETPBM(3)
β¨ NAME β¨
libnetpbm β the general intro to the netpbm library, bestie π (it's a section 3 thing, aka a library function, in case the (3) had you wondering)
π¦ DESCRIPTION π¦
Okay so libnetpbm is a C programming library for reading, writing, and manipulating Netpbm images. It also contains a few general graphics manipulation tools, but lowkey it is not meant to be a graphics tools library. For actual graphics tools, Netpbm expects you to just run the Netpbm programs. From a C program, the libnetpbm function pm_system() makes that super easy. BUT β and this is the catch β since it creates a process and execs a program, that can be too heavyweight for some applications. π
To use libnetpbm services in your C program, #include the pam.h interface header file. For historical reasons, you can also get by in some cases with pbm.h, pgm.h, ppm.h, or pnm.h, but fr there's really no point to that anymore. π
The libnetpbm functions are divided into these categories:
- PBM functions. These have names that start with
pbmand work only on PBM images. - PGM functions. These have names that start with
pgmand work only on PGM images. - PPM functions. These have names that start with
ppmand work only on PPM images. - PNM functions. These have names that start with
pnmand work on PBM, PGM, and PPM images. - PAM functions. These also have names that start with
pnmand work on all the Netpbm image types. - PM functions. These are utility functions that aren't specific to any particular image format.
For new programming, you rarely need to concern yourself with the PBM, PGM, PPM, and PNM functions, because the newer PAM functions do the same thing and are easier to use. π For certain processing of bi-level images, though, the PBM functions are significantly more efficient β so like, don't sleep on those.
libnetpbm has a backward compatibility feature that means a function designed to read one format can read some others too, converting on the fly. β¨ In particular, a function that reads a PGM image will also read a PBM image, but converts it as it reads it so that for programming purposes, it is a PGM image. Similarly, a function that reads PPM can read PBM and PGM as well. And a function that reads PBM, PGM, or PPM can read a PAM that has an equivalent tuple type. It's giving β¨glow-upβ¨.
For each of the five classes of libnetpbm image processing functions, libnetpbm has an in-memory representation for a pixel, a row, and a whole image. β οΈ Do not confuse this format with the actual image format, as you would see in a file. The libnetpbm in-memory format is designed to make programming very easy. It is sometimes extremely inefficient, even more than the actual image format. For example, a pixel that a PPM image represents with 3 bytes, libnetpbm's PAM functions represent with 16 bytes. π And a pixel in a PBM image is represented by a single bit, but the PNM functions represent that pixel in memory with 96 bits. Like... 96. bestie. that's not a typo.
See Libnetpbm User's Manual(1) for the basics on using libnetpbm in a program. π
You can look up the reference information for a particular function in The libnetpbm Directory(1). π
Before Netpbm release 10 (June 2002), this library was split into four: libpbm, libpgm, libppm, and libpnm. That's largely the reason for the multiple sets of functions and scattered documentation. (not me being haunted by my 2002 past π)
πΈ 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/libnetpbm.html
and that's the whole vibe check, bestie β this page is netpbm documentation, dated December 2003, brought to you with love π mwah, go write some slay C code πβ¨
π¦ where this page comes from
- arch rolling: netpbm 10.86.51-2 Β· Artistic-1.0 AND GPL-2.0-only AND LGPL-2.0-only AND MIT
- centos-stream 10: netpbm-devel 11.09.00-1.el10 Β· BSD-3-Clause AND GPL-2.0-only AND LGPL-2.1-or-later AND GPL-3.0-or-later AND IJG AND MIT AND NTP AND PostgreSQL AND LicenseRef-MIT-CRL-Xim AND LicenseRef-Fedora-Public-Domain
- centos-stream 9: netpbm-devel 10.95.00-3.el9 Β· BSD and GPLv2 and IJG and MIT and Public Domain
- centos-stream 9: netpbm-devel 10.95.00-3.el9 Β· BSD and GPLv2 and IJG and MIT and Public Domain
- debian trixie: libnetpbm-dev 2:11.10.02-1 Β· MIT
- fedora 43: netpbm-devel 11.10.00-2.fc43 Β· BSD-3-Clause AND GPL-2.0-only AND LGPL-2.1-or-later AND GPL-3.0-or-later AND IJG AND MIT AND NTP AND PostgreSQL AND LicenseRef-MIT-CRL-Xim AND LicenseRef-Fedora-Public-Domain
- fedora 43: netpbm-devel 11.10.00-2.fc43 Β· BSD-3-Clause AND GPL-2.0-only AND LGPL-2.1-or-later AND GPL-3.0-or-later AND IJG AND MIT AND NTP AND PostgreSQL AND LicenseRef-MIT-CRL-Xim AND LicenseRef-Fedora-Public-Domain
- fedora 43: netpbm-devel 11.13.00-1.fc43 Β· BSD-3-Clause AND GPL-2.0-only AND LGPL-2.1-or-later AND GPL-3.0-or-later AND IJG AND MIT AND NTP AND PostgreSQL AND LicenseRef-MIT-CRL-Xim AND LicenseRef-Fedora-Public-Domain
- fedora 43: netpbm-devel 11.13.00-1.fc43 Β· BSD-3-Clause AND GPL-2.0-only AND LGPL-2.1-or-later AND GPL-3.0-or-later AND IJG AND MIT AND NTP AND PostgreSQL AND LicenseRef-MIT-CRL-Xim AND LicenseRef-Fedora-Public-Domain
- fedora 44: netpbm-devel 11.13.00-2.fc44 Β· BSD-3-Clause AND GPL-2.0-only AND LGPL-2.1-or-later AND GPL-3.0-or-later AND IJG AND MIT AND NTP AND PostgreSQL AND LicenseRef-MIT-CRL-Xim AND LicenseRef-Fedora-Public-Domain
- fedora 44: netpbm-devel 11.13.00-2.fc44 Β· BSD-3-Clause AND GPL-2.0-only AND LGPL-2.1-or-later AND GPL-3.0-or-later AND IJG AND MIT AND NTP AND PostgreSQL AND LicenseRef-MIT-CRL-Xim AND LicenseRef-Fedora-Public-Domain
- ubuntu noble: libnetpbm-dev 2:11.05.02-1.1build1 Β· MIT
- ubuntu resolute: libnetpbm-dev 2:11.10.02-1build1 Β· MIT
- ubuntu stonking: libnetpbm-dev 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