PAMENLARGE(1)

πŸ’– PAMENLARGE πŸ’–

ok so bestie, welcome to the Pamenlarge User Manual, part of the General Commands Manual lineup β€” she's a real one. pull up a chair, grab a strawberry πŸ“, and let's get into it.


✨ NAME ✨

pamenlarge β€” Enlarge a Netpbm image N times by duplicating pixels πŸ‘‘


🌸 SYNOPSIS 🌸

pamenlarge [-scale=integer] [-xscale=integer] [-yscale=integer]
[filename]

pamenlarge N [pnmfile]

πŸ’… DESCRIPTION πŸ’…

okay so first things first: this program is part of Netpbm(1). she's got a whole family, iykyk.

pamenlarge reads a Netpbm image as input, replicates its pixels N times, and produces a Netpbm image as output. literally just copy-paste energy but for pixels πŸ’…. the output is the same type of image as the input β€” no format glow-ups happening here.

ngl if you're enlarging by a factor of 3 or more, you should probably add a pnmsmooth step after; otherwise you can literally see the original pixels in the resulting image 😭. it's giving pixelated. no cap.

for PBM images, pamenlarge uses special fast algorithms for scale factors up to 10. for larger factors, it uses a simple but slow algorithm. as a result, you can often get a significantly faster scale by running pamenlarge multiple times. for example, enlarging by 3 and then by 5 is faster than enlarging once by 15. and because the algorithms are different for the different scale factors, some faster than others, the order matters too πŸ”₯. for example, the following examples all produce the same output β€” an image 15 times bigger on edge than the input β€” but at different speeds, each being faster than the one before:

     $ pamenlarge -scale=15 test.pbm
     $ pamenlarge -scale=5 test.pbm | pamenlarge -scale=3
     $ pamenlarge -scale=3 test.pbm | pamenlarge -scale=5

the special fast cases for factors up to 10 have existed since Release 10.50 (March 2010). the special cases for 1, 2, 3, and 5 go back to Release 10.41 (December 2007). before 10.41, there are no special scale factors and PBM enlargement is significantly slower than today for all scale factors 😭 the dark ages fr fr.

pamenlarge can enlarge only by integer factors. the slower but more general pamscale can enlarge or reduce by arbitrary factors. pamscale allows you to enlarge by resampling, which gives you smoother enlargements β€” but it is much slower. she's thorough, not speedy πŸ’€.

pamstretch is another enlarging program that enlarges by integer factors. it does a simple kind of resampling that gives you a smoothed enlargement with less computational cost. queen of efficiency ✨.

pbmreduce can reduce by integer factors, but only for PBM images.


πŸ¦‹ ARGUMENTS πŸ¦‹

as with most Netpbm programs, you can give the input file name as an argument, or omit that argument and have it come from Standard Input (and you can specify '-' for the argument to specify Standard Input explicitly). either way, we support you 🫢.

you can also specify the scale factor as an argument, for backward compatibility, but the preferred way to do that is with a -scale option, because it is easier to remember and read that way. the scale factor argument goes before the file name argument. periodt.


πŸŽ€ OPTIONS πŸŽ€

in addition to the options common to all programs based on libnetpbm (most notably -quiet, see Common Options), pamenlarge recognizes the following command line options:

  • -scale=integer β€” specifies the scale factor, both horizontal and vertical, all in one lil package πŸ’–
  • -xscale=integer β€” specifies the horizontal scale factor
  • -yscale=integer β€” specifies the vertical scale factor

okay so here's the tea on those three: -xscale specifies the horizontal scale factor; -yscale specifies the vertical scale factor and -scale specifies both.

if you specify -xscale but not -yscale, pamenlarge does not scale vertically (i.e. the vertical scale factor is 1). the converse applies if you specify -yscale and not -xscale.

🚨 you cannot specify -scale and also -xscale or yscale. pick a lane bestie.

also: you must specify at least one of these options, unless you use the deprecaated method of specifying the scale factor via argument. (yep, "deprecaated" β€” typo and all, we keep the lore intact 😌)

these options were all new in Netpbm 10.86 (March 2019). before that, use the scale argument. vintage behaviour only ✨.


🌈 HISTORY 🌈

pamenlarge was new in Netpbm 10.25 (October 2004). it is designed as a replacement for pnmenlarge by Jef Poskanzer, which was in Pbmplus as far back as 1989 πŸ‘‘. the major difference is that pamenlarge can enlarge PAM format images in addition to PNM. glow up complete.


πŸ‘€ SEE ALSO πŸ‘€

pbmreduce(1), pamscale(1), pamstretch(1), pbmpscale(1), pnmsmooth(1), pnm(1)

the whole friend group, go say hi πŸ’œ


🫢 AUTHOR 🫢

Copyright (C) 1989 by Jef Poskanzer.


πŸ“œ 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/pamenlarge.html

and that's the whole thing, bestie πŸ’– this lil icon is brought to you by netpbm documentation, dated 07 January 2019 β€” she's serving Pamenlarge User Manual(1) and honestly? obsessed. go enlarge smth. slay πŸ¦‹βœ¨

πŸ“¦ where this page comes from