PAMDEPTH(1)
π pamdepth β the "glow-up ur color depth" era π
okay so bestie, welcome to the Pamdepth User Manual, section 1 of the General Commands Manual π this is the whole vibe, let's go.
β¨ NAME β¨
pamdepth β change the depth (color resolution) in a Netpbm image π¦
β¨ SYNOPSIS β¨
pamdepth newmaxval [netpbmfile]
β¨ DESCRIPTION β¨
First thing's first: this program is part of Netpbm(1). It's giving "team player" energy π
So what does pamdepth actually DO? It reads a Netpbm image as input, changes its depth (that's the color resolution, iykyk), and writes out the resulting Netpbm image. Basically the output has a different maxval from the input, but all the same colors β apart from rounding error, which is the tiniest little messy detail we forgive π«Ά
β οΈ Reducing the depth results in some loss of information. like, you're literally throwing bits away babe, that's the deal.
Here's an example of the effect at the image format level, because seeing it >>> hearing it β¨ Assume you start with an image with maxval 100 and sample values of 50 and 100. You tell pamdepth to change it to depth 150. The output has maxval 200 and sample values 75 and 150. slay, math ate π
This program works on multi-image streams. iconic behavior honestly π
Be careful of off-by-one errors when choosing the new maxval. For instance, if you want the color values to be five bits wide, use a maxval of 31, not 32. not me almost saying 32 π don't do it.
One important use of pamdepth is to convert a new format 2-byte-per-sample PNM file to the older 1-byte-per-sample format. Before April 2000, essentially all raw (binary) format PNM files had a maxval less than 256 and one byte per sample, and many programs may rely on that. So if you specify a newmaxval less than 256, the resulting file should be readable by any program that worked with PNM files before April 2000. retro compatibility era π
πΈ Output Format πΈ
The output format (PBM, etc.) and, in the case of PAM, tuple type, of the output is usually the same as the input.
However, changing the depth of a black and white image does not make sense β except to turn it into a grayscale image β so if the input is a black and white image, pamdepth makes the output grayscale. To be more precise, and bestie we ARE being precise:
- if the input is a PBM image, the output is PGM
- if the input is a PAM with tuple type
BLACKANDWHITEorBLACKANDWHITE_ALPHA, the output is a PAM with tuple typeGRAYSCALEorGRAYSCALE_ALPHA, respectively
This conversion happens even if the new maxval is 1. no exceptions, periodt π
Before Netpbm 10.92 (September 2020), pamdepth failed if the input was PAM with a black and white tuple type and the new maxval was anything but 1. But it always promoted PBM to PGM. the glow-up was real π
β¨ OPTIONS β¨
There are no command line options defined specifically for pamdepth, but it recognizes the options common to all programs based on libnetpbm. (See Common Options.) so like, it knows the group chat rules, it just doesn't have its own thing going on π
β¨ SEE ALSO β¨
pnm(1), pam(1), pnmquant(1), ppmdither(1) pambrighten(1) pamfunc(1)
the whole friend group π«Ά
β¨ HISTORY β¨
pamdepth was new in Netpbm 10.32 (February 2006). It replaced pnmdepth, by Jef Poskanzer. pamdepth is backward compatible with pnmdepth and adds the ability to process arbitrary PAM images and the ability to process multi-image input streams. pnmdepth handled only PNM images and ignored all but the first in any stream. so pamdepth really said "i'm the upgrade, bestie" π
β¨ 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/pamdepth.html
okay that's the whole page, tysm for reading π this was the netpbm documentation, version dated 26 August 2020. mwah, bye bestie! π β¨ππ¦
π¦ where this page comes from
- 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