From Avisynth wiki
Jump to: navigation, search
Author ErazorTT
Version r10
Download GradationCurve_r10.7z
Category Adjustment Filters
License Public Domain
Discussion Doom9 Thread


[edit] Description

Computes and applies gradation curves based on given anchor points. Like what Photoshop, Gimp and Paint.NET do in the Curves setting. Can also load Photoshop acv and GIMP crv curve files.

[edit] Requirements

[edit] Syntax and Parameters

ApplyGradationCurves(clip, string "lumaPoints", string "redPoints", string "greenPoints", string "bluePoints", string "curvesFile", string "plotsPath")

clip   =
Clip to which to apply the gradation curves

string  lumaPoints = ""
string  redPoints = ""
string  greenPoints = ""
string  bluePoints = ""
Pair wise points given to define the mapping from the input values and the output values. Each pair is the x and y coordinates of an anchor point through which the gradation curve goes. You must provide at least two points. The points provided should cover almost the whole range of values you want to map. The points can be given in the 8 bits representation independently of the actual clip bit depth, the curve will be scaled automatically. If given, the points have priority over the "curvesFile".

string  curvesFile = ""
File containing the curves. This can be used instead of giving the anchor points using the strings "lumaPoints", "redPoints", "greenPoints", "bluePoints". Supported are Photoshop *.acv files and GIMP curve files in the "old format", these must contain anchor points. Path must be given using forward slashes "/" and not backslashes "\". You need to have permission to read from there!

string  plotsPath = ""
If given, plots showing the applied curves are saved at the location. a plot of the curve is saved as a Bitmap file on the location given. The path must be given using forward slashes "/" and not backslashes "\". You need to have permission to write there!

[edit] Examples

Example 1: Adjust Luma directly on TV scale (the values are NOT compatible to the ones Photoshop shows):


Example 2: Adjust Luma on PC scale such that the values of the luminosity channel can be taken directly from Photoshop. Transformation in 16 bit might be preferable.


Example 3: Adjust RGB on a YUV clip by transforming to PlanarRGB and back to YUV using 16 bit processing, to mitigate banding and rounding errors. Values can again be taken directly from the respective channels in Photoshop.


Example 4: Like previous example but now loading the values from the acv file


[edit] Changelog

Jan 18, 2019: r9
- first functional release

Dec 19, 2021: r10
- fix bug in crv-file reader

Personal tools