9
$\begingroup$

I am wanting to make some animations that have a reduced color range (similar to 80s/90s CGI.)

I know of ways to reduce that for still imagery such as in photoshop, but I know of no ways to do this within Blender. The only color options change the color from 8 to 16 bit.

Is there a compositor node to do this, or would I have to batch edit every frame separately than compile later into a movie file? Or is there another program better suited for this like Final Cut Pro?

$\endgroup$
3
$\begingroup$

Posterization and quantization are tricky beasts.

You could do a simple quantization hack via a script to reduce the display referred output range, by dividing the display referred output by a value and forcing quantization.

Mapping colours to a more limited sampled set would be more challenging, as it would require evaluating the display referred output for clumpings of values, then aligning the other values to that set based on distance.

$\endgroup$
  • $\begingroup$ Although marked as answer. The answer is not really describing how to create a reduced color animation; "you could script that" isnt an answer, provide example by code then. Answers like these can be put in comments. $\endgroup$ – user3800527 Sep 26 '17 at 13:32
  • 1
    $\begingroup$ @user3800527 the core of this answer is the last paragraph. a true quantization which properly maps that ranges is impossible to achieve in blender. my answer below is just a hack, which might suffice for one or the other user. $\endgroup$ – aliasguru Sep 27 '17 at 6:07
9
+50
$\begingroup$

I assume from your question that you're just seeking to emulate a certain look, and you're not seeking to actually output that data into a file format with reduced range. In other words, it shall look like it was an image with reduced bit depth, but in fact it's a normal 8 bit jpeg or png that you're outputting.

If that's the case, that look could somewhat be emulated using node groups. I've put together a little demo with a Suzanne head and a random image (Agent327 header from the Blender.org homepage), which run through a custom node group:

Please keep in mind that the node group does not do any sophisticated range mapping. There is no analysation of surrounding pixel data to produce an image which is as close as possible to the original. It really just tries to add the - usually unwanted - fake posterization.

To do this, the image needs to be split up into its individual channels, as we want to work on the mathematical values there:

splitting up the channels

You'll see two things in this tree:

  1. using separateRGB and combineRGB nodes, I split the channels into its individual components, and then run each through a custom node group
  2. There is a Power function involved (Gamma). What I'm doing here is mangling the Display Referred pixel values instead of the scene linear ones. The mapping to target values looks more natural this way. You can mute both gamma nodes to see the difference when testing with the photo. This also means for you that you need to take care what you feed the node group with, as it expects the input to be within a 0.0 - 1.0 range

The channel node group itself looks like this:

channel mangling

The user outside of the node group sets a number of colors per channel. But the range the group works on starts at 0, so a 0 - 7 range = 8 colors. That's why I subtract 1 at the beginning of the tree.

Then comes the actual trick. The values are multiplied by the number of colors. So now, the channel values range from 0.0 to 7.0. But usually they are something like 3.76622. Now, that value is going through the Round node. There, 3.76622 becomes 4.0, while 3.422 becomes 3.0. By that, the channel values are spread apart, the smooth interpolations disappear, posterization happens. The result is divided again by the number of colors, to get back to 0 - 1 range.

Result:

Input:

Agent Smooth

Output (with 8 colors):

Agent Posterized

$\endgroup$
  • $\begingroup$ This is a very impressive and flexible approach. By using HSVA it grants a strictly limited set of hues; using it also with saturation reinforces the effect. Very nice indeed. $\endgroup$ – Solar Granulation Jul 12 '18 at 9:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.