{
    "mode": "man",
    "parameter": "extendedopacity",
    "section": "5",
    "url": "https://www.chedong.com/phpMan.php/man/extendedopacity/5/json",
    "generated": "2026-10-05T00:04:32Z",
    "sections": {
        "Image Processing ...and Extrapolation(5) File Formats ManualImage Processing ...and Extrapolation(5)": {
            "content": "",
            "subsections": []
        },
        "Created: 17 April 2003": {
            "content": "",
            "subsections": []
        },
        "NAME": {
            "content": "extendedopacity - theory of netpbm interpolation and extrapolation\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This  page  is a copy of http://www.sgi.com/misc/grafica/interp/ on April 17, 2003, with some\nslight formatting changes, included in the Netpbm documentation for  convenience.   Since  at\nleast June 11, 2005, the source page has been missing.\n\n",
            "subsections": []
        },
        "Image Processing By Interpolation and Extrapolation": {
            "content": "Paul Haeberli and Douglas Voorhies\n\n",
            "subsections": [
                {
                    "name": "Introduction",
                    "content": "Interpolation  and  extrapolation  between  two images offers a general, unifying approach to\nmany common point and area image processing operations.   Brightness,  contrast,  saturation,\ntint, and sharpness can all be controlled with one formula, separately or simultaneously.  In\nseveral cases, there are also performance benefits.\n\nLinear interpolation is often used to blend two images.  Blend fractions (alpha) and (1 - al‐\npha) are used in a weighted average of each component of each pixel:\n\nout = (1 - alpha)*in0 + alpha*in1\n\n\nTypically  alpha  is a number in the range 0.0 to 1.0.  This is commonly used to linearly in‐\nterpolate two images.  What is less often considered is that alpha may range beyond  the  in‐\nterval 0.0 to 1.0.  Values above one subtract a portion of in0 while scaling in1.  Values be‐\nlow 0.0 have the opposite effect.\n\nExtrapolation  is particularly useful if a degenerate version of the image is used as the im‐\nage to get \"away from.\"  Extrapolating away from a black-and-white  image  increases  satura‐\ntion.   Extrapolating  away  from a blurred image increases sharpness.  The interpolation/ex‐\ntrapolation formula offers one-parameter control, making display of a series of images,  each\ndiffering in brightness, contrast, sharpness, color, or saturation, particularly easy to com‐\npute, and inviting hardware acceleration.\n\nIn  the following examples, a single alpha value is used per image.  However other processing\nis possible, for example where alpha is a function of X and Y, or  where  a  brush  footprint\ncontrols alpha near the cursor.\n\n"
                },
                {
                    "name": "Changing Brightness",
                    "content": "To  control image brightness, we use pure black as the degenerate (zero alpha) image.  Inter‐\npolation darkens the image, and extrapolation brightens it.  In both cases,  brighter  pixels\nare affected more.\n"
                },
                {
                    "name": "brightness",
                    "content": ""
                },
                {
                    "name": "Changing Contrast",
                    "content": "Contrast can be controlled using a constant gray image with the average image luminance.  In‐\nterpolation  reduces contrast and extrapolation boosts it.  Negative alpha generates inverted\nimages with varying contrast.  In all cases, the average image luminance is constant.\n"
                },
                {
                    "name": "contrast",
                    "content": "If middle gray or the average pixel color is used instead, contrast  is  again  altered,  but\nwith  middle  gray or the average color left unaffected.  Shades and colors far away from the\nchosen value are most affected.\n\n"
                },
                {
                    "name": "Changing Saturation",
                    "content": "To alter saturation, pixel components must move towards or away from  the  pixel's  luminance\nvalue.  By  using  a  black-and-white  image as the degenerate version, saturation can be de‐\ncreased using interpolation, and increased using extrapolation.  This avoids  computationally\nmore expensive conversions to and from HSV space.  Repeated update in an interactive applica‐\ntion  is especially fast, since the luminance of each pixel need not be recomputed.  Negative\nalpha preserves luminance but inverts the hue of the input image.\n"
                },
                {
                    "name": "saturation",
                    "content": ""
                },
                {
                    "name": "Sharpening an Image",
                    "content": "Any convolution, such as sharpening or blurring, can be adjusted  by  this  approach.   If  a\nblurred  image  is used as the degenerate image, interpolation attenuates high frequencies to\nvarying degrees, and extrapolation boosts them, sharpening  the  image  by  unsharp  masking.\nVarying  alpha  acts  as a kernel scale factor, so a series of convolutions differing only in\nscale can be done easily, independent of the size of  the  kernel.   Since  blurring,  unlike\nsharpening, is often a separable operation, sharpening by extrapolation may be far more effi‐\ncient for large kernels.\n"
                },
                {
                    "name": "sharpening",
                    "content": "Note  that  global contrast control, local contrast control, and sharpening form a continuum.\nGlobal contrast pushes pixel components towards or away from  the  average  image  luminance.\nLocal  contrast  is  similar,  but uses local area luminance.  Unsharp masking is the extreme\ncase, using only the color of nearby pixels.\n\n"
                },
                {
                    "name": "Combined Processing",
                    "content": "An unusual property of this interpolation/extrapolation approach is that all of  these  image\nparameters  may  be altered simultaneously.  Here sharpness, tint, and saturation are all al‐\ntered.\n"
                },
                {
                    "name": "combined",
                    "content": ""
                },
                {
                    "name": "Conclusion",
                    "content": "Image applications frequently need to produce multiple degrees of manipulation interactively.\nImage applications frequently need to  interactively  manipulate  an  image  by  continuously\nchanging  a  single  parameter.  The best hardware mechanisms employ a single \"inner loop\" to\nachieve a wide variety of effects.  Interpolation and extrapolation of images can be a unify‐\ning approach, providing a single function that can do many  common  image  processing  opera‐\ntions.\n\nSince a degenerate image is sometimes easier to calculate, extrapolation may offer a more ef‐\nficient method to achieve effects such as sharpening or saturation.  Blending is a linear op‐\neration, and so it must be performed in linear, not gamma-warped space.  Component range must\nalso be monitored, since clamping, especially of the degenerate image, causes inaccuracy.\n\nThese image manipulation techniques can be used in paint programs to easily implement brushes\nthat saturate, sharpen, lighten, darken, or modify contrast and color.  The only major change\nneeded is to work with alpha values outside the range 0.0 to 1.0.\n\nIt  is surprising and unfortunate how many graphics software packages needlessly limit inter‐\npolant values to the range 0.0 to 1.0.  Application developers should allow users to extrapo‐\nlate parameters when practical.\n"
                },
                {
                    "name": "References",
                    "content": "For a slightly extended version of this article, see: P. Haeberli and D. Voorhies. Image Pro‐\ncessing by Linear Interpolation and Extrapolation.  IRIS Universe Magazine  No.  28,  Silicon\nGraphics, Aug, 1994.\n"
                }
            ]
        },
        "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/extendedopacity.html\n\nnetpbm documentation                                        Image Processing ...and Extrapolation(5)",
            "subsections": []
        }
    },
    "summary": "extendedopacity - theory of netpbm interpolation and extrapolation",
    "flags": [],
    "examples": [],
    "see_also": []
}