GradationCurve
Abstract | |
---|---|
Author | ErazorTT |
Version | r10 |
Download | GradationCurve_r10.7z |
Category | Adjustment Filters |
License | Public Domain |
Discussion | Doom9 Thread |
Contents |
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.
Requirements
- AviSynth+ (x86 and x64)
- Supported color formats: PlanarRGB, YUV 420,422,444 8-16 bits
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
- clip =
- 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 lumaPoints = ""
- 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 curvesFile = ""
- 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!
- string plotsPath = ""
Examples
Example 1: Adjust Luma directly on TV scale (the values are NOT compatible to the ones Photoshop shows):
ApplyGradationCurves(lumaPoints="16,16,107,127,235,235",plotsPath="C:/Users/Public/")
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.
ConvertBits(16).ColorYUV(levels="TV->PC") ApplyGradationCurves(lumaPoints="0,0,107,127,255,255",plotsPath="C:/Users/Public/") ColorYUV(levels="PC->TV").ConvertBits(8,dither=1)
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.
ConvertBits(16).ConvertToPlanarRGB(matrix="Rec709") pointsR="0,0,104,127,199,255" pointsG="0,0,104,127,218,255" pointsB="0,0,87,127,185,255" ApplyGradationCurve(redPoints=pointsR,greenPoints=pointsG,bluePoints=pointsB,plotsPath="C:/Users/Public/") ConvertToYUV420(matrix="Rec709").ConvertBits(8,dither=1)
Example 4: Like previous example but now loading the values from the acv file
ConvertBits(16).ConvertToPlanarRGB(matrix="Rec709") ApplyGradationCurves(curvesFile="C:/Users/Public/exampleAcv.acv",plotsPath="C:/Users/Public/") ConvertToYUV420(matrix="Rec709").ConvertBits(8,dither=1)
Changelog
Jan 18, 2019: r9
- first functional release
Dec 19, 2021: r10
- fix bug in crv-file reader