{
    "mode": "man",
    "parameter": "pamscale",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/pamscale/1/json",
    "generated": "2026-08-06T16:21:48Z",
    "synopsis": "pamscale\n[\nscalefactor\n|\n{-xyfit | -xyfill | -xysize}\ncols rows\n|\n-reduce reductionfactor\n|\n[-xsize=cols | -width=cols | -xscale=factor]\n[-ysize=rows | -height=rows | -yscale=factor]\n|\n-pixels n\n]\n[\n-nomix\n|\n-filter=functionName [-window=functionName]\n]\n[-linear]\n[-reportonly]\n[-verbose]\n[pnmfile]\nMinimum  unique  abbreviation of option is acceptable.  You may use double hyphens instead of\nsingle hyphen to denote options.  You may use white space in place of the equals sign to sep‐\narate an option name from its value.",
    "sections": {
        "NAME": {
            "content": "pamscale - scale a Netpbm image\n\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "pamscale\n[\nscalefactor\n|\n{-xyfit | -xyfill | -xysize}\ncols rows\n|\n-reduce reductionfactor\n|\n[-xsize=cols | -width=cols | -xscale=factor]\n[-ysize=rows | -height=rows | -yscale=factor]\n|\n-pixels n\n]\n[\n-nomix\n|\n-filter=functionName [-window=functionName]\n]\n[-linear]\n[-reportonly]\n[-verbose]\n\n[pnmfile]\n\n\n\nMinimum  unique  abbreviation of option is acceptable.  You may use double hyphens instead of\nsingle hyphen to denote options.  You may use white space in place of the equals sign to sep‐\narate an option name from its value.\n\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This program is part of Netpbm(1).\n\npamscale scales a Netpbm image by a specified factor, or scales individually horizontally and\nvertically by specified factors.\n\nYou can either enlarge (scale factor > 1) or reduce (scale factor < 1).\n\npamscale works on multi-image streams, scaling each one  independently.   But  before  Netpbm\n10.49 (December 2009), it scales only the first image and ignores the rest of the stream.\n\n",
            "subsections": [
                {
                    "name": "The Scale Factors",
                    "content": "The  options -width, -height, -xsize, -ysize, -xscale, -yscale, -xyfit, -xyfill, -reduce, and"
                },
                {
                    "name": "-pixels  -xysize",
                    "content": "and the scalefactor argument, but you shouldn't use those.\n"
                },
                {
                    "name": "-width  -height",
                    "content": "See below for rules when you specify one and not the other.\n"
                },
                {
                    "name": "-xsize  -ysize  -width  -height",
                    "content": ""
                },
                {
                    "name": "-xscale   -yscale",
                    "content": "change from source to result (e.g.  -xscale 2 means you want to double the width; -xscale  .5\nmeans you want to halve it).  See below for rules when you specify one and not the other.\n\nWhen  you  specify an absolute size or scale factor for both dimensions, pamscale scales each\ndimension independently without consideration of the aspect ratio.\n\nIf you specify one dimension as a pixel size and don't specify the other dimension,  pamscale\nscales the unspecified dimension to preserve the aspect ratio.\n\nIf  you  specify  one dimension as a scale factor and don't specify the other dimension, pam‐\nscale leaves the unspecified dimension unchanged from the input.\n\nIf you specify the scalefactor parameter instead of dimension options,  that  is  the  scale\nfactor for both dimensions.  It is equivalent to -xscale=scalefactor -yscale=scalefactor.\n\nSpecifying  the  -reduce reductionfactor option is equivalent to specifying the scalefactor\nparameter, where scalefactor is the reciprocal of reductionfactor.\n"
                },
                {
                    "name": "-xyfit",
                    "content": "fits  within the box, while preserving its aspect ratio.  -xysize is a synonym for this.  Be‐\nfore Netpbm 10.20 (January 2004), -xyfit did not exist, but -xysize did.\n"
                },
                {
                    "name": "-xyfill",
                    "content": "fills the box, while preserving its aspect ratio.  This option has existed since Netpbm 10.20\n(January 2004).\n"
                },
                {
                    "name": "-pixels",
                    "content": "that number of pixels.  If the input image is already no more than that many pixels, pamscale\njust copies it as output; pamscale does not scale up with -pixels.\n\nIf you enlarge by a factor of 3 or more, you should probably add a pnmsmooth step; otherwise,\nyou can see the original pixels in the resulting image.\n"
                },
                {
                    "name": "-reportonly",
                    "content": "The option -reportonly causes pamscale not to scale the image, but instead to report to Stan‐\ndard  Output  what scaling the options and the input image dimensions indicate.  For example,\nif you specify\n-xyfill 100 100 -reportonly\n\nand the input image is 500 x 400, pamscale tells you that this means scaling by .25 to end up\nwith a 125 x 100 image.\n\nYou can use this information with other programs, such as pamscalefixed, that don't  have  as\nrich facilities as pamscale for choosing scale factors.\n\nThe  output  is  intended  to be convenient for machine processing.  In the example above, it\nwould be\n\n\n500 400 0.250000 0.250000 125 100\n\n\n\nThe output is a single line of text per input image, with blank-separated tokens as follows.\n\n\n\n•      input width in pixels, decimal unsigned integer\n\n•      input height in pixels, decimal unsigned integer\n\n•      horizontal scale factor, floating point decimal, unsigned\n\n•      vertical scale factor, floating point decimal, unsigned\n\n•      output width in pixels, decimal unsigned integer\n\n•      output height in pixels, decimal unsigned integer\n\n"
                },
                {
                    "name": "-reportonly",
                    "content": ""
                },
                {
                    "name": "Usage Notes",
                    "content": "A useful application of pamscale is to blur an image.  Scale it down (without -nomix) to dis‐\ncard some information, then scale it back up using pamstretch.\n\nOr scale it back up with pamscale and create a \"pixelized\" image, which is  sort  of  a  com‐\nputer-age version of blurring.\n\n\n"
                },
                {
                    "name": "Transparency",
                    "content": "pamscale  understands  transparency  and properly mixes pixels considering the pixels' trans‐\nparency.\n\nProper mixing does not mean just mixing the transparency value and the color component values\nseparately.  In a PAM image, a pixel which is not opaque represents  a  color  that  contains\nlight of the foreground color indicated explicitly in the PAM and light of a background color\nto be named later.  But the numerical scale of a color component sample in a PAM is as if the\npixel  is  opaque.   So  a  pixel that is supposed to contain half-strength red light for the\nforeground plus some light from the background has a red color sample that says full red  and\na  transparency  sample that says 50% opaque.  In order to mix pixels, you have to first con‐\nvert the color sample values to numbers that represent amount of light directly (i.e.  multi‐\nply by the opaqueness) and after mixing, convert back (divide by the opaqueness).\n\n"
                },
                {
                    "name": "Input And Output Image Types",
                    "content": "pamscale  produces  output of the same type (and tuple type if the type is PAM) as the input,\nexcept if the input is PBM.  In that case, the output is PGM with maxval 255.  The purpose of\nthis is to allow meaningful pixel mixing.  Note that there is no  equivalent  exception  when\nthe input is PAM.  If the PAM input tuple type is BLACKANDWHITE, the PAM output tuple type is\nalso BLACKANDWHITE, and you get no meaningful pixel mixing.\n\nIf  you  want PBM output with PBM input, use pamditherbw to convert pamscale's output to PBM.\nAlso consider pbmreduce.\n\npamscale's function is essentially undefined for PAM input images that are not of tuple  type\nRGB,  GRAYSCALE, BLACKANDWHITE, or the ALPHA variations of those.  (By standard Netpbm back‐\nward compatibility, this includes PBM, PGM, and PPM images).\n\nYou might think it would have an obvious effect on other tuple types, but remember  that  the\naforementioned  tuple types have gamma-adjusted sample values, and pamscale uses that fact in\nits calculations.  And it treats a transparency plane different from any other plane.\n\npamscale does not simply reject unrecognized tuple types because there's a  possibility  that\njust  by coincidence you can get useful function out of it with some other tuple type and the\nright combination of options (consider -linear in particular).\n\n\n"
                },
                {
                    "name": "Methods Of Scaling",
                    "content": "There are numerous ways to scale an image.  pamscale implements a bunch of them;  you  select\namong them with invocation options.\n"
                },
                {
                    "name": "Pixel Mixing",
                    "content": "Pamscale's  default  method is pixel mixing.  To understand this, imagine the source image as\ncomposed of square tiles.  Each tile is a pixel and has uniform color.  The tiles are all the\nsame size.  Now take a transparent sheet the size of the target image, marked with  a  square\ngrid  of  tiles the same size.  Stretch or compress the source image to the size of the sheet\nand lay the sheet over the source.\n\nEach cell in the overlay grid stands for a pixel of the target image.  For  example,  if  you\nare scaling a 100x200 image up by 1.5, the source image is 100 x 200 tiles, and the transpar‐\nent sheet is marked off in 150 x 300 cells.\n\nEach  cell covers parts of multiple tiles.  To make the target image, just color in each cell\nwith the color which is the average of the colors the cell covers -- weighted by  the  amount\nof  that color it covers.  A cell in our example might cover 4/9 of a blue tile, 2/9 of a red\ntile, 2/9 of a green tile, and 1/9 of a white tile.  So the target pixel  would  be  somewhat\nunsaturated blue.\n\nWhen you are scaling up or down by an integer, the results are simple.  When scaling up, pix‐\nels  get  duplicated.  When scaling down, pixels get thrown away.  In either case, the colors\nin the target image are a subset of those in the source image.\n\nWhen the scale factor is weirder than that, the target image can have colors that didn't  ex‐\nist  in the original.  For example, a red pixel next to a white pixel in the source might be‐\ncome a red pixel, a pink pixel, and a white pixel in the target.\n\nThis method tends to replicate what the human eye does as it moves closer to or further  away\nfrom  an  image.  It also tends to replicate what the human eye sees, when far enough away to\nmake the pixelization disappear, if an image is not made of pixels and  simply  stretches  or\nshrinks.\n"
                },
                {
                    "name": "Discrete Sampling",
                    "content": "Discrete  sampling  is basically the same thing as pixel mixing except that, in the model de‐\nscribed above, instead of averaging the colors of the tiles the cell covers, you pick the one\ncolor that covers the most area.\n\nThe result you see is that when you enlarge an image, pixels get duplicated and when you  re‐\nduce an image, some pixels get discarded.\n\nThe  advantage  of  this is that you end up with an image made from the same color palette as\nthe original.  Sometimes that's important.\n\nThe disadvantage is that it distorts the picture.  If you scale up by 1.5  horizontally,  for\nexample,  the  even numbered input pixels are doubled in the output and the odd numbered ones\nare copied singly.  If you have a bunch of one pixel wide lines in the source, you  may  find\nthat  some of them stretch to 2 pixels, others remain 1 pixel when you enlarge.  When you re‐\nduce, you may find that some of the lines disappear completely.\n\nYou select discrete sampling with pamscale's -nomix option.\n\nActually, -nomix doesn't do exactly what I described above.   It  does  the  scaling  in  two\npasses - first horizontal, then vertical.  This can produce slightly different results.\n\nThere is one common case in which one often finds it burdensome to have pamscale make up col‐\nors that weren't there originally: Where one is working with an image format such as GIF that\nhas  a  limited number of possible colors per image.  If you take a GIF with 256 colors, con‐\nvert it to PPM, scale by .625, and convert back to GIF, you will probably find that  the  re‐\nduced  image has way more than 256 colors, and therefore cannot be converted to GIF.  One way\nto solve this problem is to do the reduction with discrete sampling instead of pixel  mixing.\nProbably  a better way is to do the pixel mixing, but then color quantize the result with pn‐\nmquant before converting to GIF.\n\nWhen the scale factor is an integer (which means you're scaling up),  discrete  sampling  and\npixel mixing are identical -- output pixels are always just N copies of the input pixels.  In\nthis  case, though, consider using pamstretch instead of pamscale to get the added pixels in‐\nterpolated instead of just copied and thereby get a smoother enlargement.\n\npamscale's discrete sampling is faster than pixel mixing, but  pamenlarge  is  faster  still.\npamenlarge works only on integer enlargements.\n\ndiscrete sampling (-nomix) was new in Netpbm 9.24 (January 2002).\n\n"
                },
                {
                    "name": "Resampling",
                    "content": "Resampling  assumes  that the source image is a discrete sampling of some original continuous\nimage.  That is, it assumes there is some non-pixelized original image and each pixel of  the\nsource  image  is  simply the color of that image at a particular point.  Those points, natu‐\nrally, are the intersections of a square grid.\n\nThe idea of resampling is just to compute that original image, then sample it at a  different\nfrequency (a grid of a different scale).\n\nThe  problem, of course, is that sampling necessarily throws away the information you need to\nrebuild the original image.  So we have to make a bunch of assumptions about  the  makeup  of\nthe original image.\n\nYou  tell  pamscale to use the resampling method by specifying the -filter option.  The value\nof this option is the name of a function, from the set listed below.\n\nTo explain resampling, we are going to talk about a simple one dimensional scaling -- scaling\na single row of grayscale pixels horizontally.  If you can understand that,  you  can  easily\nunderstand  how  to do a whole image: Scale each of the rows of the image, then scale each of\nthe resulting columns.  And scale each of the color component planes separately.\n\nAs a first step in resampling, pamscale converts the source image, which is a set of discrete\npixel values, into a continuous step function.  A step function is a function whose graph  is\na staircase-y thing.\n\nNow,  we  convolve  the  step  function with a proper scaling of the filter function that you\nidentified with -filter.  If you don't know what  the  mathematical  concept  of  convolution\n(convolving)  is,  you are officially lost.  You cannot understand this explanation.  The re‐\nsult of this convolution is the imaginary original continuous image we've been talking about.\n\nFinally, we make target pixels by picking values from that function.\n\nTo understand what is going on, we use Fourier analysis:\n\nThe idea is that the only difference between our step function and  the  original  continuous\nfunction  (remember that we constructed the step function from the source image, which is it‐\nself a sampling of the original continuous function) is that the step function has a bunch of\nhigh frequency Fourier components added.  If we could chop out all the higher frequency  com‐\nponents  of  the  step  function,  and know that they're all higher than any frequency in the\noriginal function, we'd have the original function back.\n\nThe resampling method assumes that the original function was sampled at a  high  enough  fre‐\nquency  to form a perfect sampling.  A perfect sampling is one from which you can recover ex‐\nactly the original continuous function.  The Nyquist theorem says that as long as your sample\nrate is at least twice the highest frequency in your original function, the sampling is  per‐\nfect.  So we assume that the image is a sampling of something whose highest frequency is half\nthe  sample  rate (pixel resolution) or less.  Given that, our filtering does in fact recover\nthe original continuous image from the samples (pixels).\n\nTo chop out all the components above a certain frequency, we just multiply the Fourier trans‐\nform of the step function by a rectangle function.\n\nWe could find the Fourier transform of the step function, multiply it by  a  rectangle  func‐\ntion,  and then Fourier transform the result back, but there's an easier way.  Mathematicians\ntell us that multiplying in the frequency domain is equivalent to convolving in the time  do‐\nmain.   That  means  multiplying  the Fourier transform of F by a rectangle function R is the\nsame as convolving F with the Fourier transform of R.  It's a lot better to take the  Fourier\ntransform  of  R, and build it into pamscale than to have pamscale take the Fourier transform\nof the input image dynamically.\n\nThat leaves only one question:  What is the Fourier transform of a rectangle  function?   An‐\nswer: sinc.  Recall from math that sinc is defined as sinc(x) = sin(PI*x)/PI*x.\n\nHence,  when  you  specify -filter=sinc, you are effectively passing the step function of the\nsource image through a low pass frequency filter and recovering a good approximation  of  the\noriginal continuous image.\n"
                },
                {
                    "name": "Refiltering",
                    "content": "There's  another  twist:  If you simply sample the reconstructed original continuous image at\nthe new sample rate, and that new sample rate isn't at least twice the highest  frequency  in\nthe  original  continuous image, you won't get a perfect sampling.  In fact, you'll get some‐\nthing with ugly aliasing in it.  Note that this can't be a problem  when  you're  scaling  up\n(increasing the sample rate), because the fact that the old sample rate was above the Nyquist\nlevel  means  so is the new one.  But when scaling down, it's a problem.  Obviously, you have\nto give up image quality when scaling down, but aliasing is not the best way to do it.   It's\nbetter  just  to  remove  high frequency components from the original continuous image before\nsampling, and then get a perfect sampling of that.\n\nTherefore, pamscale filters out frequencies above half the new sample rate before picking the\nnew samples.\n"
                },
                {
                    "name": "Approximations",
                    "content": "Unfortunately, pamscale doesn't do the convolution precisely.  Instead of evaluating the fil‐\nter function at every point, it samples it -- assumes that it doesn't change any  more  often\nthan  the step function does.  pamscale could actually do the true integration fairly easily.\nSince the filter functions are built into the program, the integrals of them  could  be  too.\nMaybe someday it will.\n\nThere  is one more complication with the Fourier analysis.  sinc has nonzero values on out to\ninfinity and minus infinity.  That makes it hard to compute a convolution with  it.   So  in‐\nstead, there are filter functions that approximate sinc but are nonzero only within a manage‐\nable range.  To get those, you multiply the sinc function by a window function, which you se‐\nlect  with  the -window option.  The same holds for other filter functions that go on forever\nlike sinc.  By default, for a filter that needs a window function, the window function is the\nBlackman function.  Hanning, Hamming, and Kaiser are alternatives.\n"
                },
                {
                    "name": "Filter Functions Besides Sinc",
                    "content": "The math described above works only with sinc as the filter function.  pamscale  offers  many\nother  filter  functions,  though.  Some of these approximate sinc and are faster to compute.\nFor most of them, I have no idea of the mathematical explanation for them, but people do find\nthey give pleasing results.  They may not be based on resampling at all, but just exploit the\nconvolution that is coincidentally part of a resampling calculation.\n\nFor some filter functions, you can tell just by looking at the convolution how they vary  the\nresampling process from the perfect one based on sinc:\n\nThe  impulse  filter assumes that the original continuous image is in fact a step function --\nthe very one we computed as the first step in the resampling.  This is mathematically equiva‐\nlent to the discrete sampling method.\n\nThe box (rectangle) filter assumes the original image is a piecewise  linear  function.   Its\ngraph  just  looks  like  straight lines connecting the pixel values.  This is mathematically\nequivalent to the pixel mixing method (but mixing brightness, not light  intensity,  so  like\npamscale -linear) when scaling down, and interpolation (ala pamstretch) when scaling up.\n"
                },
                {
                    "name": "Gamma",
                    "content": "pamscale  assumes  the underlying continuous function is a function of brightness (as opposed\nto light intensity), and therefore does all this math using the gamma-adjusted numbers  found\nin  a  PNM or PAM image.  The -linear option is not available with resampling (it causes pam‐\nscale to fail), because it wouldn't be useful enough to justify the implementation effort.\n\nResampling (-filter) was new in Netpbm 10.20 (January 2004).\n"
                },
                {
                    "name": "The filter and window functions",
                    "content": "Here is a list of the function names you can specify for the -filter or  -windowoption.   For\nmost  of  them,  you're  on your own to figure out just what the function is and what kind of\nscaling it does.  These are common functions from mathematics.  Note that some of these  make\nsense only as filter functions and some make sense only as window functions.\n\n\n\npoint  The graph of this is a single point at X=0, Y=1.\n\n\nbox    The graph of this is a rectangle sitting on the X axis and centered on the Y axis with\nheight 1 and base 1.\n\n\ntriangle\nThe graph of this is an isosceles triangle sitting on the X axis and centered on the Y\naxis with height 1 and base 2.\n\n\nquadratic\n\ncubic\n\ncatrom\n\nmitchell\n\ngauss\n\nsinc\n\nbessel\n\nhanning\n\nhamming\n\nblackman\n\nkaiser\n\nnormal\n\nhermite\n\nlanczos\nNot documented\n\n\n\n"
                },
                {
                    "name": "Linear vs Gamma-adjusted",
                    "content": "The  pixel  mixing  scaling  method described above involves intensities of pixels (more pre‐\ncisely, it involves individual intensities of primary color components of pixels).   But  the\nPNM  and  PNM-equivalent  PAM image formats represent intensities with gamma-adjusted numbers\nthat are not linearly proportional to intensity.  So pamscale, by default, performs a  calcu‐\nlation  on  each  sample read from its input and each sample written to its output to convert\nbetween these gamma-adjusted numbers and internal intensity-proportional numbers.\n\nSometimes you are not working with true PNM or PAM images, but rather a  variation  in  which\nthe sample values are in fact directly proportional to intensity.  If so, use the -linear op‐\ntion to tell pamscale this.  pamscale then will skip the conversions.\n\nThe  conversion  takes  time.  In one experiment, it increased by a factor of 10 the time re‐\nquired to reduce an image.  And the  difference  between  intensity-proportional  values  and\ngamma-adjusted  values  may be small enough that you would barely see a difference in the re‐\nsult if you just pretended that the gamma-adjusted  values  were  in  fact  intensity-propor‐\ntional.   So just to save time, at the expense of some image quality, you can specify -linear\neven when you have true PPM input and expect true PPM output.\n\nFor the first 13 years of Netpbm's life, until Netpbm 10.20 (January 2004), pamscale's prede‐\ncessor pnmscale always treated the PPM samples as  intensity-proportional  even  though  they\nwere  not, and drew few complaints.  So using -linear as a lie is a reasonable thing to do if\nspeed is important to you.  But if speed is important, you also should  consider  the  -nomix\noption and pnmscalefixed.\n\nAnother  technique  to consider is to convert your PNM image to the linear variation with pn‐\nmgamma, run pamscale on it and other transformations that like linear PNM, and  then  convert\nit  back to true PNM with pnmgamma -ungamma.  pnmgamma is often faster than pamscale in doing\nthe conversion.\n\nWith -nomix, -linear has no effect.  That's because pamscale does not concern itself with the\nmeaning of the sample values in this method; pamscale just copies numbers from its  input  to\nits output.\n\n\n"
                },
                {
                    "name": "Precision",
                    "content": "pamscale  uses  floating  point arithmetic internally.  There is a speed cost associated with\nthis.  For some images, you can get the acceptable results (in fact, sometimes identical  re‐\nsults) faster with pnmscalefixed, which uses fixed point arithmetic.  pnmscalefixed may, how‐\never,  distort your image a little.  See the pnmscalefixed user manual for a complete discus‐\nsion of the difference.\n\n"
                }
            ]
        },
        "OPTIONS": {
            "content": "In addition to the options common to all programs based on libnetpbm  (most  notably  -quiet,\nsee \u001b]8;;index.html#commonoptions\u001b\\ Common Options\u001b]8;;\u001b\\ ), pamscale recognizes the following command line options:\n\n\n\n",
            "subsections": [
                {
                    "name": "-width",
                    "content": ""
                },
                {
                    "name": "-height",
                    "content": ""
                },
                {
                    "name": "-xsize",
                    "content": ""
                },
                {
                    "name": "-ysize",
                    "content": ""
                },
                {
                    "name": "-xscale",
                    "content": ""
                },
                {
                    "name": "-yscale",
                    "content": ""
                },
                {
                    "name": "-xyfit",
                    "content": ""
                },
                {
                    "name": "-xyfill",
                    "content": ""
                },
                {
                    "name": "-reduce",
                    "content": ""
                },
                {
                    "name": "-pixels",
                    "content": ""
                },
                {
                    "name": "-xysize",
                    "content": "These options determine the horizontal and vertical scale factors.\n\nSee \u001b]8;;#scalefactor\u001b\\The Scale Factors\u001b]8;;\u001b\\ .\n\n"
                },
                {
                    "name": "-reportonly",
                    "content": "This causes pamscale not to scale the image, but instead to\nreport to Standard Output what scaling the options and the input image\ndimensions indicate.\n\nSee \u001b]8;;#reportonly\u001b\\-reportonly\u001b]8;;\u001b\\ .\n\n"
                },
                {
                    "name": "-nomix",
                    "content": "This option selects \u001b]8;;#sampling\u001b\\discrete sampling\u001b]8;;\u001b\\  as the\n\n\u001b]8;;#methods\u001b\\method of scaling\u001b]8;;\u001b\\ .\n\n"
                },
                {
                    "name": "-filter=_",
                    "content": "This option selects \u001b]8;;#resampling\u001b\\resampling\u001b]8;;\u001b\\  as the\n\n\u001b]8;;#methods\u001b\\method of scaling\u001b]8;;\u001b\\ .\n\n"
                },
                {
                    "name": "-window=_",
                    "content": "This option selects a window function to modify the filter function\nspecified with -filter.\n\nSee \u001b]8;;#resampling\u001b\\Resampling\u001b]8;;\u001b\\ .\n\n"
                },
                {
                    "name": "-verbose",
                    "content": "This option causes pamscale to issue messages to Standard Error about\nthe scaling.\n\n\n\n\n"
                }
            ]
        },
        "SEE ALSO": {
            "content": "pnmscalefixed(1),   pamstretch(1),  pamstretch-gen(1),  pamditherbw(1),  pbmreduce(1),  pbmp‐\nscale(1), pamenlarge(1), pnmsmooth(1), pamcut(1), pnmgamma(1), pnmscale(1), pnm(1), pam(1)\n\n",
            "subsections": []
        },
        "HISTORY": {
            "content": "pamscale was new in Netpbm 10.20 (January 2004).  It was adapted from,  and  obsoleted,  pnm‐\nscale.   pamscale's  primary  difference  from pnmscale is that it handles the PAM format and\nuses the \"pam\" facilities of the Netpbm programming library.  But it also  added  the  resam‐\npling class of scaling method.  Furthermore, it properly does its pixel mixing arithmetic (by\ndefault)  using  intensity-proportional  values instead of the gamma-adjusted values the pnm‐\nscale uses.  To get the old pnmscale arithmetic, you can specify the -linear option.\n\nThe intensity proportional stuff came out of suggestions by Adam M Costello in January 2004.\n\nThe resampling algorithms are mostly taken from code contributed by Michael Reinelt in Decem‐\nber 2003.\n\nThe version of pnmscale from which pamscale was derived, itself evolved out of  the  original\nPbmplus  version  of  pnmscale by Jef Poskanzer (1989, 1991).  But none of that original code\nremains.\n",
            "subsections": []
        },
        "DOCUMENT SOURCE": {
            "content": "This manual page was generated by the Netpbm tool 'makeman' from  HTML  source.   The  master\ndocumentation is at\n\nhttp://netpbm.sourceforge.net/doc/pamscale.html\n\nnetpbm documentation                        29 June 2020                     Pamscale User Manual(1)",
            "subsections": []
        }
    },
    "summary": "pamscale - scale a Netpbm image",
    "flags": [
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "These options determine the horizontal and vertical scale factors. See \u001b]8;;#scalefactor\u001b\\The Scale Factors\u001b]8;;\u001b\\ ."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "This causes pamscale not to scale the image, but instead to report to Standard Output what scaling the options and the input image dimensions indicate. See \u001b]8;;#reportonly\u001b\\-reportonly\u001b]8;;\u001b\\ ."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "This option selects \u001b]8;;#sampling\u001b\\discrete sampling\u001b]8;;\u001b\\ as the \u001b]8;;#methods\u001b\\method of scaling\u001b]8;;\u001b\\ ."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "This option selects \u001b]8;;#resampling\u001b\\resampling\u001b]8;;\u001b\\ as the \u001b]8;;#methods\u001b\\method of scaling\u001b]8;;\u001b\\ ."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "This option selects a window function to modify the filter function specified with -filter. See \u001b]8;;#resampling\u001b\\Resampling\u001b]8;;\u001b\\ ."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "This option causes pamscale to issue messages to Standard Error about the scaling."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "pnmscalefixed",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pnmscalefixed/1/json"
        },
        {
            "name": "pamstretch",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pamstretch/1/json"
        },
        {
            "name": "pamstretch-gen",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pamstretch-gen/1/json"
        },
        {
            "name": "pamditherbw",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pamditherbw/1/json"
        },
        {
            "name": "pbmreduce",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pbmreduce/1/json"
        },
        {
            "name": "scale",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/scale/1/json"
        },
        {
            "name": "pamenlarge",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pamenlarge/1/json"
        },
        {
            "name": "pnmsmooth",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pnmsmooth/1/json"
        },
        {
            "name": "pamcut",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pamcut/1/json"
        },
        {
            "name": "pnmgamma",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pnmgamma/1/json"
        },
        {
            "name": "pnmscale",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pnmscale/1/json"
        },
        {
            "name": "pnm",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pnm/1/json"
        },
        {
            "name": "pam",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pam/1/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Scale a Netpbm image.",
        "examples": [
            {
                "description": "Scale an image such that the result has the specified dimensions",
                "command": "pamscale {{-wid|-width}} {{width}} {{-h|-height}} {{height}} {{path/to/input.pam}} > {{path/to/output.pam}}"
            },
            {
                "description": "Scale an image such that the result has the specified width, keeping the aspect ratio",
                "command": "pamscale {{-wid|-width}} {{width}} {{path/to/input.pam}} > {{path/to/output.pam}}"
            },
            {
                "description": "Scale an image such that its width and height is changed by the specified factors",
                "command": "pamscale {{-xsc|-xscale}} {{x_factor}} {{-ysc|-yscale}} {{y_factor}} {{path/to/input.pam}} > {{path/to/output.pam}}"
            },
            {
                "description": "Scale an image such that it fits into the specified bounding box while preserving its aspect ratio",
                "command": "pamscale -xyfit {{bbox_width}} {{bbox_height}} {{path/to/input.pam}} > {{path/to/output.pam}}"
            },
            {
                "description": "Scale an image such that it completely fills the specified box while preserving its aspect ratio",
                "command": "pamscale -xyfill {{box_width}} {{box_height}} {{path/to/input.pam}} > {{path/to/output.pam}}"
            }
        ]
    }
}