HistogramAdjust
(Updates) |
(→Syntax and Parameters) |
||
Line 26: | Line 26: | ||
== [[Script variables|Syntax and Parameters]] == | == [[Script variables|Syntax and Parameters]] == | ||
− | :{{Template:FuncDef|<!-- function name -->HistogramAdjust(''clip'', ''<!-- par 1 type -->int | + | :{{Template:FuncDef|<!-- function name -->HistogramAdjust(''clip'', ''<!-- par 1 type -->int type, clip mclip, int mf, int w, int limit, int rgb <!-- par 1 name -->)}} |
<br> | <br> | ||
::{{Par2| |clip| }} | ::{{Par2| |clip| }} | ||
:::Input clip. | :::Input clip. | ||
− | |||
− | |||
− | |||
<br> | <br> | ||
::{{Par2|<!-- par 2 type -->string|<!-- par 2 name -->type|<!-- par 2 default value -->"equal"}} | ::{{Par2|<!-- par 2 type -->string|<!-- par 2 name -->type|<!-- par 2 default value -->"equal"}} | ||
− | ::: | + | :::The following is a table of Histogram values in %ages, to be specified only if 'table' is true |
<br> | <br> | ||
− | ::{{Par2|<!-- par 3 type --> | + | ::{{Par2|<!-- par 3 type -->int|<!-- par 3 name -->|<!-- par 3 default value -->}} |
− | ::: | + | :::Luma value % of maximum. |
<br> | <br> | ||
− | ::{{Par2|<!-- par 4 type -->clip|<!-- par 4 name --> | + | ::{{Par2|<!-- par 4 type -->clip|<!-- par 4 name -->|<!-- par 4 default value -->}} |
− | ::: | + | :::% age of population or cumulative population at this luma value |
<br> | <br> | ||
− | ::{{Par2|<!-- par 5 type -->int|<!-- par 5 name --> | + | ::{{Par2|<!-- par 5 type -->int|<!-- par 5 name -->type|<!-- par 5 default value -->1}} |
− | ::: | + | :::Type of process |
<br> | <br> | ||
− | ::{{Par2|<!-- par 6 type --> | + | ::{{Par2|<!-- par 6 type -->clip|<!-- par 6 name -->mclip|<!-- par 6 default value -->dummy clip}} |
− | ::: | + | :::Clip in which image for matching is available. |
<br> | <br> | ||
− | ::{{Par2|<!-- par 7 type --> | + | ::{{Par2|<!-- par 7 type -->integer, may be specified for type = 2 option|<!-- par 7 name -->w|<!-- par 7 default value -->0}} |
− | :::<!-- | + | :::<!-- frame number on clip for matching. |
<br> | <br> | ||
− | ::{{Par2|<!-- par 8 type -->int|<!-- par 8 name --> | + | ::{{Par2|<!-- par 8 type -->int|<!-- par 8 name -->limit|<!-- par 8 default value -->100}} |
− | ::: | + | :::limit on % of change in value from original for tweaking allowed. |
<br> | <br> | ||
− | ::{{Par2|<!-- par 9 type -->int|<!-- par 9 name --> | + | ::{{Par2|<!-- par 9 type -->int|<!-- par 9 name -->rgb|<!-- par 9 default value -->1}} |
− | ::: | + | :::percentage of deviation from original value of luma to be allowed. |
<br> | <br> | ||
Revision as of 07:06, 23 April 2018
Abstract | |
---|---|
Author | V.C.Mohan |
Version | 25 Aug 2017 |
Download | modPlus.7z |
Category | External filters |
License | GPLv2 |
Discussion | HistogramAdjust plugin |
Contents |
Description
This function adjusts the histogram of a frame by either equalizing it or by matching with histogram of another image, or with given histogram table of values.
The function accepts RGB, YUY2 and Planar color formats. Clip to be processed and to be used for matching need not have identical color formats and dimensions. For example processing clip can be YV12 , 720 X 480 pixels while matching clip is YUY2, 256 X 16 pixels. However their bit depths must be same.
If matching with given table values, then matching clip need not be specified. The second parameter is a table of integer pairs.Each pair consists of Luma ( intensity)value and the second number is %population (type = 3) or %cummulative population (type = 4) at this value.The table is normalized by the function and so approximate values are OK. Not more than 25 pairs can be specified. It will be possible to input by table any desired histogram shape. The plugin linearly interpolates and extrapolates to construct a full normalized histogram from these values. In case of RGB input the selected color histogram is tweaked ( in case all 3 color components of RGB input are to be tweaked the function may be invoked in the script 3 times). For other formats only Y value histogram is tweaked.
Requirements
- AviSynth+ r2347 or greater
- source video: progressive
- color formats -->Supported color formats: YUY2, YV12,YV16, YV24, YV411, Y8
Syntax and Parameters
- HistogramAdjust(clip, int type, clip mclip, int mf, int w, int limit, int rgb )
- clip =
- Input clip.
- clip =
- type string = "equal"
- The following is a table of Histogram values in %ages, to be specified only if 'table' is true
- type string = "equal"
- int =
- Luma value % of maximum.
- int =
- clip =
- % age of population or cumulative population at this luma value
- clip =
- type int = 1
- Type of process
- type int = 1
- mclip clip = dummy clip
- Clip in which image for matching is available.
- mclip clip = dummy clip
- 0 w =
- int|limit|100}}
- limit on % of change in value from original for tweaking allowed.
- 0 w =
- rgb int = 1
- percentage of deviation from original value of luma to be allowed.
- rgb int = 1
Examples
- Usage examples:-
- TweakHist()
- TweakHist(c, type=2, mclip=mm, mf=26)
- TweakHist(c, 15, 2, 30, 12, 50, 33, 90, 12, 150, 35, 200, 10, type=3, limit=50)
- TweakHist(20, 1, 150, 100, 255, 110, type=4, limit=70)
- RGB input. Repeated for each color
- TweakHist(limit = 70, rgb = 0)
- TweakHist(limit = 70, rgb = 1)
- TweakHist(limit = 50, rgb = 2)
Back to External Filters ←