EXTENDEDOPACITY(5)

πŸ“¦
version 11.13.03 Β· 2 versions
  • 11.13.03 Β· debian bookworm, debian trixie, opensuse-leap 16.0, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 10.86.51 Β· arch rolling
, in debian bookworm, debian trixie, opensuse-leap 16.0, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸŽ€ NAME πŸŽ€

extendedopacity β€” bestie, it's the whole theory of netpbm interpolation and extrapolation πŸ’–


πŸ’– DESCRIPTION πŸ’–

okay so real talk: this page is a straight-up copy of http://www.sgi.com/misc/grafica/interp/ grabbed on April 17, 2003, with a few lil formatting glow-ups, and it got tucked into the Netpbm docs just for convenience. and here's the tea 😭 β€” since at least June 11, 2005, the original source page has been missing. gone. ghosted us. so this copy is the moment, fr fr.

✨ Image Processing By Interpolation and Extrapolation ✨

by Paul Haeberli and Douglas Voorhies β€” icons only πŸ‘‘

🌸 Introduction 🌸

Interpolation and extrapolation between two images? lowkey a general, unifying approach to SO many common point and area image processing operations. brightness, contrast, saturation, tint, and sharpness β€” all controllable with one formula, separately or at the same time. and in several cases there are performance benefits too. slay. πŸ’…

Linear interpolation is the classic move for blending two images. blend fractions (alpha) and (1 - alpha) go into a weighted average of each component of each pixel:

out = (1 - alpha)*in0 + alpha*in1

Typically alpha is a number in the range 0.0 to 1.0. that's the standard linear interpolation of two images, everyone knows her. but what's less often considered (and this is the part that's giving main character energy) is that alpha may range beyond the interval 0.0 to 1.0. values above one subtract a portion of in0 while scaling in1. values below 0.0 have the opposite effect. ✨

Extrapolation is especially useful if a degenerate version of the image is used as the image to get "away from." extrapolating away from a black-and-white image increases saturation. extrapolating away from a blurred image increases sharpness. the interpolation/extrapolation formula offers one-parameter control, which makes displaying a series of images β€” each differing in brightness, contrast, sharpness, color, or saturation β€” particularly easy to compute, and it's inviting hardware acceleration. no cap. πŸš€

In the following examples, a single alpha value is used per image. however, other processing is possible, for example where alpha is a function of X and Y, or where a brush footprint controls alpha near the cursor. so many options, obsessed. πŸ–ŒοΈ

πŸ”† Changing Brightness πŸ”†

to control image brightness, we use pure black as the degenerate (zero alpha) image. interpolation darkens the image, and extrapolation brightens it. in both cases, brighter pixels are affected more. yes bestie, the bright ones get the most attention, as always πŸ’€

brightness

πŸŒ— Changing Contrast πŸŒ—

Contrast can be controlled using a constant gray image with the average image luminance. interpolation reduces contrast and extrapolation boosts it. negative alpha generates inverted images with varying contrast. and in all cases, the average image luminance is constant. consistent queen. πŸ‘‘

contrast

If middle gray or the average pixel color is used instead, contrast is again altered, but this time with middle gray or the average color left unaffected. shades and colors far away from the chosen value are the ones most affected. the further from the vibe, the bigger the glow-up. 🌈

🌺 Changing Saturation 🌺

to alter saturation, pixel components must move towards or away from the pixel's luminance value. by using a black-and-white image as the degenerate version, saturation can be decreased using interpolation and increased using extrapolation. this avoids the computationally more expensive conversions to and from HSV space β€” so efficient, we love to see it. repeated update in an interactive application is especially fast, since the luminance of each pixel need not be recomputed. negative alpha preserves luminance but inverts the hue of the input image. chaotic, iconic. πŸ¦‹

saturation

πŸ”ͺ Sharpening an Image πŸ”ͺ

any convolution β€” sharpening or blurring, whatever β€” can be adjusted by this approach. if a blurred image is used as the degenerate image, interpolation attenuates high frequencies to varying degrees, and extrapolation boosts them, sharpening the image by unsharp masking. varying alpha acts as a kernel scale factor, so a series of convolutions differing only in scale can be done easily, independent of the size of the kernel. and since blurring, unlike sharpening, is often a separable operation, sharpening by extrapolation may be far more efficient for large kernels. efficiency?? we stan. πŸ’…

sharpening

note that global contrast control, local contrast control, and sharpening form a continuum. global contrast pushes pixel components towards or away from the average image luminance. local contrast is similar, but uses local area luminance. unsharp masking is the extreme case, using only the color of nearby pixels. it's giving spectrum. 🌈

🎨 Combined Processing 🎨

an unusual property of this interpolation/extrapolation approach is that all of these image parameters may be altered simultaneously. here sharpness, tint, and saturation are all altered. all at once. multitasking icon. πŸ”₯

combined

🏁 Conclusion 🏁

Image applications frequently need to produce multiple degrees of manipulation interactively. image applications frequently need to interactively manipulate an image by continuously changing a single parameter. the best hardware mechanisms employ a single "inner loop" to achieve a wide variety of effects. interpolation and extrapolation of images can be a unifying approach, providing a single function that can do many common image processing operations. one function, many slays. periodt. πŸ’–

Since a degenerate image is sometimes easier to calculate, extrapolation may offer a more efficient method to achieve effects such as sharpening or saturation. blending is a linear operation, and so it must be performed in linear, not gamma-warped space. component range must also be monitored, since clamping β€” especially of the degenerate image β€” causes inaccuracy. ⚠️

heads up bestie: linear space only, and keep an eye on your component range. clamping the degenerate image will mess with your accuracy, no cap.

These image manipulation techniques can be used in paint programs to easily implement brushes that saturate, sharpen, lighten, darken, or modify contrast and color. the only major change needed is to work with alpha values outside the range 0.0 to 1.0. that's it. that's the whole upgrade. πŸŽ€

It is surprising and unfortunate how many graphics software packages needlessly limit interpolant values to the range 0.0 to 1.0. application developers should allow users to extrapolate parameters when practical. let the people extrapolate, fr fr. 😀

πŸ“š References πŸ“š

For a slightly extended version of this article, see: P. Haeberli and D. Voorhies. Image Processing by Linear Interpolation and Extrapolation. IRIS Universe Magazine No. 28, Silicon Graphics, Aug, 1994.


🫢 DOCUMENT SOURCE 🫢

This manual page was generated by the Netpbm tool makeman from HTML source. the master documentation lives at:

http://netpbm.sourceforge.net/doc/extendedopacity.html

and that's the whole page, bestie πŸ’œ this one came out of the netpbm documentation, and the original was created way back on 17 April 2003 β€” Image Proce...trapolation(5) forever in our hearts. go extrapolate something iconic. βœ¨πŸ‘‘πŸ’…

πŸ“¦ where this page comes from