Color Correction Curves
Color Correction Lookup Texture

Color Correction Ramp Texture

Color Correction allows you apply arbitrary color correction to your scene as a postprocessing effect (just like the Curves tool in Photoshop or Gimp). This page explains how to setup color correction in Photoshop and then apply exactly the same color correction at runtime in Unity.

Like with all image effects, make sure to have the Standard Assets Effects package installed.

Color correction applied to the scene. Color ramp used (magnified) is shown at the right.
Color correction applied to the scene. Color ramp used (magnified) is shown at the right.
Color ramp used for the image above.
Color ramp used for the image above.

Getting color correction from Photoshop into Unity

  1. Take a screenshot of a typical scene in your game
  2. Open it in Photoshop and color correct using the Image->Adjustments->Curves
  3. Save the .acv file file from the dialog using Save…
  4. Open Pro Standard Assets->Image Based->color correction ramp.png in Photoshop
  5. Now apply color correction to the ramp image: open Image->Adjustments->Curves again and load your saved .acv file
  6. Select your camera in Unity and select Component->Image Effects->Color Correction to add color correction effect. Select your modified color ramp.
  7. Hit Play to see the effect in action!

Details

Color correction works by remapping the original image colors through the color ramp image (sized 256x1):

  1. result.red = pixel’s red value in ramp image at (original.red + RampOffsetR) index
  2. result.green = pixel’s green value in ramp image at (original.green + RampOffsetG) index
  3. result.blue = pixel’s blue value in ramp image at (original.blue + RampOffsetB) index. So for example, to invert the colors in the image you only need to flip the original color ramp horizontally (so that it goes from white to black instead of from black to white).

A simpler version of color remapping that only remaps based on luminance can be achieved with Grayscale image effect.

Tips:

  • The color correction ramp image should not have mip-maps. Turn them off in Import Settings. It should also be set to Clamp mode.

Hardware Support

This effect should run on all hardware that Unity supports.

Color Correction Curves
Color Correction Lookup Texture