Reverse compositing – now with video!

If you’ve used Mistika (or any other software) for compositing images with an alpha channel, you’ve probably had challenges with premultiplied or matted colors. Mistikas Comp3D layers have a parameter labeled Attributes Premultiply* which let’s you work as if the image was never premultiplied as all. This works well for with basic premultiplied/black matted images, but what if it’s matted against another color or even a background image? Let’s have a look at how to get around this and even use white-matted PSD’s directly in Mistika.

* The parameter labeled premultiply should rather be labeled premultiplied, as setting it to yes implies that it’s already been multiplied by the alpha and that Mistika should not do it again when compositing. Correct me if wrong.

Technical details

Digital compositing takes a foreground (f), an alpha channel (a) and a background (b) to create a composite (c). This must be done for each color channel (r, g, b):

c = α f + (1 − α) b

What we want is basically to extract the original foreground from a matted/composited file. It’s basic algebra, and when isolating f, we get something like this:

( c – (1 – a) b ) / a = f

When using this in a new composite, we can save a lot of computing power by not dividing by alpha, but instead enable the premultiplied parameter in the Comp3D layer:

premultiplied f = c – (1 – a) b

Stacking it

The easiest stack is for white matted images like psd files. Since the background is always 1 we don’t need to multiply the inverted alpha at all:

  • Channels: RGB = RGB – inv A

If the background is not 0 (black, premultiplied) or 1 (white), we need a bigger stack:

  • Channels: RGB = RGB1 -RGB2
    • Foreground w/alpha
    • Channels: RGB = RGB * A2
      • Background
      • Foreground w/alpha

This requires both inputs to be the same resolution, so if you have a files in different size than your working resolution, you can’t just use a solid in that color as background. You can however use the following trick to create a solid with the same resolution as your image:

  1. Create a Solid effect and set/eyedrop the matte color
  2. Duplicate your image and put a Channels effect on it, and set Red, Green and Blue Operation to Out=1
  3. Copy the Red, Green and Blue color parameters from the solid into the Scale paramaters of Red, Green and Blue

You now have a solid with the same dimensions as your input!

Take a look at the video on top of the page, and make sure you have a look at these stacks. Enjoy.

Hyperspeed is live

The Hyperspeed project is a rebirth of the Efficient Mistika Project. Hyperspeed is built from ground up to provide a stable and robust framework for post production environments based around SGO Mistika systems.

In addition to various tools, workflow scripts, effects and other tweaks, it includes lots of useful python classes.
Think of it as an unofficial Python API for Mistika.

Hyperspeed is Open Source on GitHub

To Kilimanjaro or not to Kilimanjaro

This case is from a while back, but it really shows the value of invisible effects done right.

What is real and what is not?
What is real and what is not?

(more…)

A different view of Bøler

When producer Kjetil Omberg and director Ole Endresen came to Hocus Focus to finish The Wendy Effect, I was tasked with quite a few VFX shots. Not many of these were planned for ahead, but would still tie the movie tighter together and enhance the feel beyond what is possible with just a grade. Among other things, I tweaked a lot of scenery to create a more urban feel.

Comp3D builder

It’s been months since I first created this, but I guess I just forgot to post it here …
gravityeyelids.com/cb is an online tool for procedurally creating Comp3D setups for Mistika. It’s an real time saver when it comes to creating grids, carousels etc. with lots of layers.

Mistika and ProRes output

There’s no official support from ProRes output in Mistika yet, but using Baptiste Coudurier’s fantastic ffmbc we can still encode them on linux. (more…)

JS clean for Mistika 6.5

From version 6.5, Mistika is no longer tied to using a static path for all .js files. This is good news, but also means my old jsClean.py script will not work properly from anymore.

I’ve therefore made a new script,  which let’s you pick .env files and folders of .js files manually. All .js files in those folders NOT being used in any of the .env files will be moved to a trash folder (so you can flush cache and see that you still have everything you need, before you delete those files permanently.) (more…)

EMP 0.3 update

EMP (the Efficient Mistika Project) is collection of tools to ease daily work and speed up repetitive tasks.

The release candidate for EMP 0.3 is out. Get it <a href=”http://gravityeyelids.com/emp/emp_0.3rc1.tgz”>here</a>, and enjoy the following tools:

(more…)

Mistika project shortcut


This might seem useless to some of you, but if you’re like me, you easily get tired of doing the same things over again. Like browsing to your project directory outside Mistika because the built-in file manager ain’t always enough. (more…)

orb update

I’ve just finished putting in support for all effect names and colors in the Online Reel Browser, and it’s getting more useful every day.

I’ve made a new front page where all public postings will appear, and the upload page has also been given an overhaul.

Although images can be uploaded, they are not shown yet, so that’s probably the next thing on my list. I will also be creating an interface to modify your own uploads, so stay tuned!

PS: From what I see, no one other than me has even tried uploading anything yet. C’mon now!

Online Reel Browser (and a couple of nice stacks)


I’ve parsed Mistika reels to web sites before, and on the Hocus Focus intranet, we can read group names and lengths, and notes for any active Mistika project on our SAN.
But how cool wouldn’t it be to see the actual timeline in a browser? I started the ORB (Online Reel Browser) as an experiment, but now that the basic platform is up and running, I realize this could be a great way to share stacks and reels with other people!

There is still some work to be done, and these are probably the main points:

  • Set names and colors of all effects.
  • Test in multiple browsers.
    My primary browser is Opera 11, but it seems to work well in recent versions of Firefox and Chrome as well.
  • Add metadata for each stack.
    Name, uploader, time, description etc. would be nice…
  • There are probably some bugs.

Meanwhile, have a look at the two stacks below and feel free to upload your own as well. And let me know what you think =)

Rolling shutter fix
Big, heavy and time-consuming stack, but if you really need to remove rolling shutter, this is a way. The values (Time-Time) are set in increments to counter the sensor lag. The values are set for my EOS 550D, so you might need to change them for other cameras. Make sure you render each Timewarp individually (at least that was needed in the Mistika version I made it in).

Flicker filter/light leveler
Great for evening out stop-motion or auto-exposed footage. Make sure the lowest feedback is only on the first frame (this will reset when you change the length of the dummy group).