HistogramAdjust
(→Syntax and Parameters) |
(Update page to match HistogramAdjust) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | + | {{FilterCat4|External_filters|Plugins|Adjustment_filters|Levels_and_Chroma_filters}} | |
− | {{FilterCat4|External_filters|Plugins| | + | |
− | + | ||
{{Filter3 | {{Filter3 | ||
− | | | + | |{{Author/vcmohan}} |
− | | | + | |18 oct 2015 |
− | |[http://www.avisynth.nl/users/vcmohan/ | + | |[http://www.avisynth.nl/users/vcmohan/HistogramAdjust/HistogramAdjust_2_6.zip HistogramAdjust_2_6.zip] |
|4=<!-- category -->External filters | |4=<!-- category -->External filters | ||
|5=<!-- license -->[https://www.gnu.org/licenses/gpl-2.0.txt GPLv2] | |5=<!-- license -->[https://www.gnu.org/licenses/gpl-2.0.txt GPLv2] | ||
− | |6=<!-- discussion URL -->[https://forum.doom9.org/showthread.php?p=719889#post719889 | + | |6=<!-- discussion URL -->[https://forum.doom9.org/showthread.php?p=719889#post719889 Doom9 Forum]}} |
<br> | <br> | ||
== Description == | == Description == | ||
− | + | [[HistogramAdjust]], 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. | |
+ | Windowed equalization. In this mode the window for deriving the input clip histogram, steps half window size each time. This windowed processing may not be suitable for all images. Possible blocky appearance. 3 window sizes for coarse, medium and fine output. Use of small value for limit may give better results | ||
− | + | 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 = 4) or cumulative population (type = 5) at this value.The table is normalized by the plugin and so approximate values are OK. Due to limitation of number of parameters that can be input through AviSynth, 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 adjusted. For other formats Y value histogram is adjusted. | |
+ | |||
+ | *Official documentation: http://www.avisynth.nl/users/vcmohan/HistogramAdjust/HistogramAdjust.html | ||
+ | |||
+ | *For AviSynth+ see [[modPlus]], includes high bit depth colorspace support and 64-bit. | ||
<br> | <br> | ||
== Requirements == | == Requirements == | ||
− | * AviSynth+ | + | * [x86]: [[AviSynth+]] or [https://sourceforge.net/projects/avisynth2/ AviSynth 2.6] |
− | * | + | * Supported color formats: [[RGB24]], [[RGB32]], [[YUY2]], [[Y8]], [[YV12]], [[YV16]], [[YV24]] |
− | + | ||
<br> | <br> | ||
− | |||
== [[Script variables|Syntax and Parameters]] == | == [[Script variables|Syntax and Parameters]] == | ||
− | :{{Template:FuncDef| | + | :{{Template:FuncDef|TweakHist (clip, int*, int "type", clip "mclip", int "mf", int "limit", int "wsize", int "rgb")}} |
<br> | <br> | ||
::{{Par2| |clip| }} | ::{{Par2| |clip| }} | ||
− | ::: Input clip | + | :::Input clip. |
<br> | <br> | ||
− | ::{{Par2| | + | ::{{Par2| |clip| }} |
− | ::: | + | :::The following is a table of Histogram values, to be specified only if <code>table</code> is true. |
− | :::* | + | :::* Luma value: integer, 0 to 255 and to increase monotonically. |
+ | :::* Population or cummulative population at this luma value: integer, non negative. In case of <code>type=5</code>, should monotonically increase and Max value is 256. | ||
<br> | <br> | ||
− | ::{{Par2| | + | ::{{Par2|type|int|1}} |
− | ::: | + | ::: Type of process: |
+ | :::* 1 : full frame equalization | ||
+ | :::* 2 : windowed equalization | ||
+ | :::* 3 : matching with specified frame | ||
+ | :::* 4 : matching with given table of Luma, population | ||
+ | :::* 5 : luma vs cummulative population | ||
<br> | <br> | ||
− | ::{{Par2| | + | ::{{Par2|mclip|clip|}} |
− | ::: | + | ::: Clip in which image for matching is available. Valid clip to be specified only if required. |
+ | ::: Input clip to be processed and clip to be used for matching do not need to have identical color formats and dimensions. | ||
+ | ::: For example processing clip can be YV12, 720 X 480 pixels while matching clip is YV16, 256 X 16 pixels. | ||
<br> | <br> | ||
− | ::{{Par2| | + | ::{{Par2|mf|int|0}} |
− | ::: | + | :::Frame number on clip for matching |
+ | <br> | ||
+ | ::{{Par2|limit|int|100}} | ||
+ | ::: Limit on % of change in value allowed. | ||
+ | :::* Range: 1 to 100 | ||
+ | <br> | ||
+ | ::{{Par2|wsize|int|2}} | ||
+ | :::If windowed processing opted size of window. | ||
+ | :::*1 : coarse | ||
+ | :::*2 : medium | ||
+ | :::*3 : fine | ||
+ | <br> | ||
+ | ::{{Par2|rgb|int|1}} | ||
+ | :::Color of RGB input to process: | ||
+ | :::*0 : Red | ||
+ | :::*1 : Green | ||
+ | :::*2 : Blue | ||
<br> | <br> | ||
== Examples == | == Examples == | ||
− | + | HistogramAdjust() | |
− | + | HistogramAdjust(c,type=3,mclip=mm,mf=26) | |
− | + | HistogramAdjust(c,15,2, 30,12, 50, 33, 90, 12,150,35,200,10, type=4,limit=50) | |
− | + | HistogramAdjust(20,1,150,100,255,110, type=5,limit = 70) | |
− | + | *RGB input. Repeated for each color | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
+ | HistogramAdjust(limit = 70,rgb = 0) | ||
+ | HistogramAdjust(limit = 70,rgb = 1) | ||
+ | HistogramAdjust(limit = 50, rgb = 2) | ||
<br> | <br> | ||
+ | <br> | ||
+ | ----------------------------------------------- | ||
+ | '''Back to [[External_filters#Levels_and_Chroma|External Filters]] ←''' | ||
----------------------------------------------- | ----------------------------------------------- | ||
− |
Latest revision as of 03:30, 8 June 2020
Abstract | |
---|---|
Author | V. C. Mohan |
Version | 18 oct 2015 |
Download | HistogramAdjust_2_6.zip |
Category | External filters |
License | GPLv2 |
Discussion | Doom9 Forum |
Contents |
[edit] Description
HistogramAdjust, 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. Windowed equalization. In this mode the window for deriving the input clip histogram, steps half window size each time. This windowed processing may not be suitable for all images. Possible blocky appearance. 3 window sizes for coarse, medium and fine output. Use of small value for limit may give better results
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 = 4) or cumulative population (type = 5) at this value.The table is normalized by the plugin and so approximate values are OK. Due to limitation of number of parameters that can be input through AviSynth, 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 adjusted. For other formats Y value histogram is adjusted.
- Official documentation: http://www.avisynth.nl/users/vcmohan/HistogramAdjust/HistogramAdjust.html
- For AviSynth+ see modPlus, includes high bit depth colorspace support and 64-bit.
[edit] Requirements
[edit] Syntax and Parameters
- TweakHist (clip, int*, int "type", clip "mclip", int "mf", int "limit", int "wsize", int "rgb")
- clip =
- Input clip.
- clip =
- clip =
- The following is a table of Histogram values, to be specified only if
table
is true.- Luma value: integer, 0 to 255 and to increase monotonically.
- Population or cummulative population at this luma value: integer, non negative. In case of
type=5
, should monotonically increase and Max value is 256.
- The following is a table of Histogram values, to be specified only if
- clip =
- int type = 1
- Type of process:
- 1 : full frame equalization
- 2 : windowed equalization
- 3 : matching with specified frame
- 4 : matching with given table of Luma, population
- 5 : luma vs cummulative population
- Type of process:
- int type = 1
- clip mclip =
- Clip in which image for matching is available. Valid clip to be specified only if required.
- Input clip to be processed and clip to be used for matching do not need to have identical color formats and dimensions.
- For example processing clip can be YV12, 720 X 480 pixels while matching clip is YV16, 256 X 16 pixels.
- clip mclip =
- int mf = 0
- Frame number on clip for matching
- int mf = 0
- int limit = 100
- Limit on % of change in value allowed.
- Range: 1 to 100
- Limit on % of change in value allowed.
- int limit = 100
- int wsize = 2
- If windowed processing opted size of window.
- 1 : coarse
- 2 : medium
- 3 : fine
- If windowed processing opted size of window.
- int wsize = 2
- int rgb = 1
- Color of RGB input to process:
- 0 : Red
- 1 : Green
- 2 : Blue
- Color of RGB input to process:
- int rgb = 1
[edit] Examples
HistogramAdjust() HistogramAdjust(c,type=3,mclip=mm,mf=26) HistogramAdjust(c,15,2, 30,12, 50, 33, 90, 12,150,35,200,10, type=4,limit=50) HistogramAdjust(20,1,150,100,255,110, type=5,limit = 70)
- RGB input. Repeated for each color
HistogramAdjust(limit = 70,rgb = 0) HistogramAdjust(limit = 70,rgb = 1) HistogramAdjust(limit = 50, rgb = 2)
Back to External Filters ←