PGMKERNEL(1)
๐ pgmkernel ๐
okay bestie, welcome to the manual for pgmkernel โ aka the little Netpbm girlie who generates a convolution kernel. she's under the General Commands Manual umbrella, and I'm about to make her make sense. ๐
โจ NAME โจ
pgmkernel โ generate a convolution kernel
๐ธ SYNOPSIS ๐ธ
pgmkernel [-weight=number] [-maxval=] {size | width height}
a few little quality-of-life notes so you don't fumble the bag: Minimum unique abbreviation of the option is acceptable. you can also use double hyphens instead of a single hyphen to denote options. and yes bestie, you may use white space in place of the equals sign to separate an option name from its value. ๐
๐ฆ DESCRIPTION ๐ฆ
so this program is part of Netpbm(1) ๐ซถ
pgmkernel generates a convolution kernel that you can use with pnmconvol. the vibe of this kernel is very specific: the weight of each location is inversely proportional to its distance from the center of the kernel. the further out you go, the less it matters. main character stays in the middle. ๐
pgmkernel generates a PGM image of width and height size if you specify one argument, or width width and height height if you specify two arguments.
and here's the actual math, because she's giving STEM girlie and we respect her for it โ pgmkernel computes the convolution function K as follows. ๐งฎ
K(i,j) = 1 / ( 1 + w * sqrt(i^2 + j^2))
where w is a coefficient specified via the -weight option. i and j are measured in pixels. K is zero everywhere beyond the specified kernel width and height โ so like, outside the box she simply does not exist. ๐
the sample values in the PGM output have this value scaled and biased using the protocol pnmconvol specifies for representing the real numbers K in PGM. (yes, that's the whole sentence, no I will not gatekeep it from you โจ)
๐ OPTIONS ๐
on top of the options common to all programs based on libnetpbm (most notably -quiet, see Common Options), pgmkernel recognizes these command line options, and honestly? she ate with these two. ๐ฅ
-weight=numberโ the distance from the center is weighted by this. a higher number means the value falls off more quickly as you go away from the center. this must be a positive real number. the default is6.0.-maxval=maxvalโ the maxval for the PGM kernel. the default is255. ๐ this option was new in Netpbm 10.65 (December 2013). before that, the maxval is always255.
heads up bestie: that -weight has to be positive, okay? no negative numbers allowed anymore โ more on that drama in HISTORY below. ๐จ
๐ญ LIMITATIONS ๐ญ
the computation time is proportional to width*height. this increases rapidly with the increase of the kernel size. a better approach could be using an FFT in these cases. so like, go big if you want but girl will be chugging through it, no cap. ๐ข
๐ HISTORY ๐
- before Netpbm 10.65 (December 2013), the output was always in Plain (text) PGM format. (now, like standard Netpbm programs, the default is raw PGM and you can get Plain PGM with a
-plainoption). โจ - before Netpbm 10.65 (December 2013), this manual said negative values for
-weightwere valid (as long as they were greater than-1.0). but the program never worked with negative numbers and it isn't clear that the result would be useful, so-weightis now required to be nonnegative and the program fails gracefully if you specify a negative value. glow-up era, honestly. ๐
๐ SEE ALSO ๐
pnmconvol(1), pnmsmooth(1) pamgauss(1) pgm(1)
๐ AUTHOR ๐
Alberto Accomazzi (alberto@cfa.harvard.edu). ๐ซถ
๐ 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/pgmkernel.html
and that's the whole thing bestie, you understood it fr fr ๐ฆโจ โ this was netpbm documentation, dated 19 December 2013, and it's the Pgmkernel User Manual(1). now go convolve something iconic. bye! ๐๐๐ธ
๐ฆ 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