Why, Oh Why, Premultiply?
Learn the Secrets of Premultiply and Unpremultiply by Steve Wright

Why, Oh Why, Premultiply?

In all my travels to conduct Nuke training around the world, one of the most vexing topics I am asked to clarify is premultiply and unpremultiply. Amazingly, the confusion actually starts with the name - premultiply. At least if a more descriptive name had been chosen we would find the subject less confusing. So how did we in the visual effects industry get stuck with such a nettlesome name?

It all started in the early 1970's, the earliest days of computer graphics. In those days the software was primitive and the computers were slow, so the CG was actually rendered in two separate passes - the RGB pass and a "transparency" pass - so the RGB pass had no anti-aliasing or semi-transparency. These were the days when 640 x 480 was considered a large image.

The RGB and transparency passes were given to the compositors of the day who then had to multiply the RGB pass by the transparency pass to introduce anti-aliasing and semi-transparency to the final image for compositing. After a time, the compositors became tired of doing this repetitive multiplication task and beseeched the CG department to upgrade their software to perform the multiplication of the RGB by the transparency for them in the renderer. Now it would come to the compositors premultiplied, meaning the RGB was already multiplied by the transparency. The world has not recovered since.

They realized that they needed to include the transparency channel as part of the image file, which meant it would now be a 4-channel image - RGB plus transparency. Scratching around for a catchy name for the new transparency channel, they turned to the Greek alphabet (alpha, beta, gamma, etc.) and, in a fit of engineering whimsy, chose the first letter, alpha, represented by the letter A. We now have the modern four-channel RGBA image file illustrated here.

No alt text provided for this image

Starting at the left with "straight color" (RGB) it shows the original color channel render before any anti-aliasing or transparency is applied. Next to that is "transparency" (alpha) which contains the anti-aliasing and transparency information and (in this example) includes a transparency gradient from the center down. Next comes "premultiplied" (RGBA) which shows the straight color multiplied by the transparency (RGB x alpha) illustrating how the premultiplied image is delivered today. And finally is "composite" which shows the premultiplied RGBA comped over a checkerboard background revealing the transparency in the lower half of the RGBA image.

Note that "straight color" is the official term for the rendered RGB channels before they are premultiplied, per Pixar. I defer to Pixar on this subject since they were such a good client - twice. At least now we know where the official term "straight color" render comes from.

There is, of course, much more to the story of premultiply and unpremultiply beyond the story of its nettlesome name. Should you be one of the many artists who are vexed by the whole premultiply / unpremultiply thing you might want to check out my clarifying webinar on the subject, "Premultiply and Unpremultiply Demystified". In that webinar you will learn, among many other things, the two "golden rules" - those ops that must be done premultiplied and those ops that must be done unpremultiplied - and why. For your viewing pleasure I even prepared a short video that describes the webinar. Just click the play button to watch.

For more information on the On Demand 'Premultiply and Unpremultiply Demystified' webinar click on the image below.

This is Steve Wright reminding you to check out all of my Nuke VFX Compositing training website at FX Ecademy where you will find this webinar and many other professional training offerings to help you succeed in the competitive world of compositing visual effects.

Comp on!

Steve Wright

Steve Wright, how would you invert depth information. Say if you have one element rendered with depth from 0 being the closest and highest value representing the farthest pixel and another element having depth information in way vice versa. If we need to merge the elements to have a combined depth information, then how to do that?

回复
Ken Pitts

Course Leader, CGI, VFX and Games Art at Solent University

5 年

Great article - going to make it compulsory for all my VFX newbies :)

EPHRAIM M.

Nuke VFX Compositor.

5 年

Sweet.

回复

要查看或添加评论,请登录

Steve Wright的更多文章

  • Steve Wright Joins Forces with EDI for Nuke Intensive Workshop

    Steve Wright Joins Forces with EDI for Nuke Intensive Workshop

    Dates: May 27 through July 5, 2019 Location: Milan, Italy Click here to view the Course Details. Italy's leading visual…

  • Google Stadia -The Total Game Changer

    Google Stadia -The Total Game Changer

    I actually started entertaining people with pixels in the early 80's when I worked at Atari as a video game programmer.…

    6 条评论
  • It's All About Workflow

    It's All About Workflow

    Whether I am visiting a visual effects studio for staff training or talking to students about their previous education…

    5 条评论

社区洞察

其他会员也浏览了