ArticleslgStudy

computer science

Digital compositing

Digital compositing is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Digital compositing rather than just read about it. In short: Digital compositing is the process of digitally assembling multiple images to make a final image, typically for print, motion pictures or screen display. It is the digital analogue of optical film compositing.

Digital compositing — main illustration
Digital compositing — illustration

Key takeaways

  • Digital compositing belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Digital compositing to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Digital compositing from memory before moving on to harder problems.

Reference excerpt

Digital compositing is the process of digitally assembling multiple images to make a final image, typically for print, motion pictures or screen display. It is the digital analogue of optical film compositing. It is a part of VFX processing.

Mathematics The basic operation used in digital compositing is known as alpha blending, where an opacity value, 'α', is used to control the proportions of two input pixel values that end up a single output pixel. As a simple example, suppose two images of the same size are available and they are to be composited. The input images are referred to as the foreground image and the background image. Each image consists of the same number of pixels. Compositing is performed by mathematically combining information from the corresponding pixels from the two input images and recording the result in a third image, which is called the composited image. Consider three pixels;

a foreground pixel, f a background pixel, b a composited adetpixel, c and

α, the opacity value of the foreground pixel. (α = 1 for an opaque foreground, α = 0 for a completely transparent foreground). A monochrome raster image where the pixel values are to be interpreted as alpha values is known as a matte. Then, considering all three colour channels, and assuming that the colour channels are expressed in a γ=1 colour space (that is to say, the measured values are proportional to light intensity), we have:

cr = α fr + (1 − α) br cg = α fg + (1 − α) bg cb = α fb + (1 − α) bb Note that if the operations are performed in a colour space where γ is not equal to 1 then the operation will lead to non-linear effects which can potentially be seen as aliasing artifacts (or "jaggies") along sharp edges in the matte. More generally, nonlinear compositing can have effects such as "halos" around composited objects, because the influence of the alpha channel is non-linear. It is possible for a compositing artist to compensate for the effects of compositing in non-linear space. Performing alpha blending is an expensive operation if performed on an entire image or 3D scene. If this operation has to be done in real time video games, there is an easy trick to boost performance.

cout = α fin + (1 − α) bin cout = α fin + bin − α bin cout = bin + α (fin − bin) By simply rewriting the mathematical expression, one can save 50% of the multiplications required.

Algebraic properties When many partially transparent layers need to be composited together, it is worthwhile to consider the algebraic properties of compositing operators used. Specifically, the associativity and commutativity determine when repeated calculation can or cannot be avoided. Consider the case when we have four layers to blend to produce the final image: F=A*(B*(C*D)) where A, B, C, D are partially transparent image layers and "*" denotes a compositing operator (with the left layer on top of the right layer). If only layer C changes, we should find a way to avoid re-blending all of the layers when computing F. Without any special considerations, four full-image blends would need to occur. For compositing operators that are commutative, such as additive blending, it is safe to re-order the blending operations. In this case, we might compute T=A*(B*D) only once and simply blend T*C to produce F, a single operation. Unfortunately, most operators are not commutative. However, many are associative, suggesting it is safe to re-group operations to F=(A*B)*(C*D), i.e. without changing their order. In this case, we may compute S:=A*B once and save this result. To form F with an associative operator, we need only do two additional compositing operations to integrate the new layer S, by computing F:=S*(C*D). This expression indicates compositing C with all of the layers below it in one step, and then blending all of the layers on top of it with the previous result to produce the final image in the second step. If all layers of an image change regularly but many layers still need to be composited (such as in distributed rendering), the commutativity of a compositing operator can still be exploited to speed up computation through parallelism even when there is no gain from pre-computation. Again, consider the image F=A*(B*(C*D)). Each compositing operation in this expression depends on the next, leading to serial computation. However, associativity can allow us to rewrite F=(A*B)*(C*D) where there are clearly two operations that do not depend on each other that may be executed in parallel. In general, we can build a tree of pair-wise compositing operations with a height that is logarithmic in the number of layers.

Software The most historically significant nonlinear compositing system was the Cineon, which operated in a logarithmic color space, which more closely mimics the natural light response of film emulsions (the Cineon System, made by Kodak, is no longer in production). Over time, the limitations have become much less significant, and now most compositing is done in a linear color space, even in cases where the source imagery is in a logarithmic color space. Compositing often also includes scaling, retouching and colour correction of images.

… excerpt ends here. Continue reading the full article.

Illustrations

Digital compositing: Several images assembled into one final image
Several images assembled into one final image

Worked examples

Example 1 — a first encounter with Digital compositing

Start with the simplest possible case. Write down what Digital compositing claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Digital compositing before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Digital compositing ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Digital compositing

In research
Digital compositing appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Digital compositing in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Digital compositing is common in secondary-school and first-year university syllabi. It links to neighbouring topics Compositing software, Film and video technology, Film and video terminology, so understanding it makes those chapters shorter.
In everyday life
Look for Digital compositing outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Digital compositing” →

How to study Digital compositing in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Digital compositing means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Digital compositing out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Digital compositing in simple terms?

Digital compositing is the process of digitally assembling multiple images to make a final image, typically for print, motion pictures or screen display. It is the digital analogue of optical film compositing.

Why does Digital compositing matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Digital compositing?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Digital compositing.

Tags

  • Compositing software
  • Film and video technology
  • Film and video terminology
  • Special effects

Keep exploring