|
|
(26 intermediate revisions by one user not shown) |
Line 1: |
Line 1: |
− | Template test,
| + | (this page reserved for future experiments) |
− | see [[ColorYUV]], [[Talk:ColorYUV]]
| + | |
− | ----
| + | |
− | == Syntax and Parameters ==
| + | |
− | {{Template:FuncDef|ColorYUV(clip [, float ''gain_y''] [, float ''off_y''] [, float ''gamma_y''] [, float ''cont_y''] [, float ''gain_u''] [, float ''off_u''] [, float ''gamma_u''] [, float ''cont_u''] [, float ''gain_v''] [, float ''off_v''] [, float ''gamma_v''] [, float ''cont_v''] [, string ''levels''] [, string ''opt''] [, boolean ''showyuv''] [, boolean ''analyze''] [, boolean ''autowhite''] [, boolean ''autogain''] [, boolean ''conditional''])}}
| + | |
− | <br>
| + | |
− | <br>
| + | |
− | :{{Par2b| |clip| |}}
| + | |
− | ::Input clip
| + | |
− | <br>
| + | |
− | :{{Par2b|gain_y|float|0}}
| + | |
− | :{{Par2b|gain_u|float|0}}
| + | |
− | :{{Par2b|gain_v|float|0}}
| + | |
− | ::A multiplier for the value which for positive values stretches the signal up from the bottom and for negative values it shrinks the signal up from the bottom. When ''gain_X'' is set to -128, all values are multiplied by 0.5. When ''gain_X'' is set to 0, it preserves the values as they are. When ''gain_X'' is 256, all values are multiplied by 2 (twice as bright). When ''gain_X'' is set to 512 all values are multiplied by 3. Thus when ''gain_X'' = k*256 for some value ''k'' then ''Y'' becomes ''(k+1)*Y'' (idem for the chroma). ''gain_X'' is valid down to -256, where the signal is set to 0.
| + | |
− | ::*Although it is possible, it doesn't make sense to apply this setting to the chroma of the signal.
| + | |
− | ::*In order to confuse you, in the filter [[Tweak]] this setting is called ''contrast''.
| + | |
− | <br>
| + | |
− | :{{Par2b|off_y|float|0}}
| + | |
− | :{{Par2b|off_u|float|0}}
| + | |
− | :{{Par2b|off_v|float|0}}
| + | |
− | ::Adds an offset (a value) to the luma or chroma values. An ''off_X'' of 16 will add 16 to all pixel values. An ''off_X'' of -32 will subtract 32 from all pixel values.
| + | |
− | <br>
| + | |
− | :{{Par2b|gamma_y|float|0}}
| + | |
− | :{{Par2b|gamma_u|float|0}}
| + | |
− | :{{Par2b|gamma_v|float|0}}
| + | |
− | ::Adjusts gamma of the specified channel as X^(1/g) where g=(''gamma_X''+256)/256. When ''gamma_X'' is set to 0, it applies a gamma of 1.0. When ''gamma_X'' is set to 256, it applies a gamma of 2.0. ''gamma_X'' is valid down to -256, where a minimal gamma of 0.01 is applied.
| + | |
− | ::*'''Note:''' gamma for chroma is not implemented (gamma_u and gamma_v are dummy parameters).
| + | |
− | <br>
| + | |
− | :{{Par2b|cont_y|float|0}}
| + | |
− | :{{Par2b|cont_u|float|0}}
| + | |
− | :{{Par2b|cont_v|float|0}}
| + | |
− | ::Like ''gain_X'', a multiplier for the value, but for positive values ''cont_X'' stretches the signal out from the center and for negative values it shrinks the signal trowards the center. This is most useful for the chroma components, where it translates to saturation. When ''cont_X'' is set to -128, all values (taken from the center) are multiplied by 0.5. When ''cont_X'' is set to 0, it preserves the values as they are. When ''cont_X'' is set to 256, all values (taken from the center) are multiplied by 2 (for Y, twice as much contrast; for U and V, twice as saturated). When ''cont_X'' is set to 512, all values (taken from the center) are multiplied by 3. Thus when ''cont_X'' = (k-1)*256'' for some value ''k '' (and zero gain) then ''U'' becomes ''128 + k*(U-128)'' (and V likewise). ''cont_X'' is valid down to -256, where the signal is set to 128.
| + | |
− | ::*Although it is possible, it doesn't make sense to apply this setting to the luma of the signal.
| + | |
− | <br>
| + | |
− | :{{Par2b|levels|string|""}}
| + | |
− | ::Can be set to either "TV->PC" or "PC->TV". This will perform a range conversion. Normally YUV values are not mapped from 0 to 255 (PC range), but a limited range (TV range). This performs conversion between the two formats. If no parameter is specified, no conversion will be made (default operation).
| + | |
− | <br>
| + | |
− | :{{Par2b|opt|string|""}}
| + | |
− | ::Can be either "coring" or "" (nothing, default setting). Specifying "coring" will clip your YUV values to the valid TV-ranges. Otherwise "invalid results" will be accepted.
| + | |
− | <br>
| + | |
− | :{{Par2b|showYUV|bool|false}}
| + | |
− | ::If ''true, ''this option will overwrite your image with a new 448x448 image showing all chroma values along the two axes. This can be useful if you need to adjust the color of your image, but need to know how the colors are arranged. At the topleft of the image, the chroma values are '16'. At the right side of the image, U is at maximum. At the bottom of the screen V is at its maximum. In the middle both chroma is 128 (or grey). See example image [[#Examples:|below]].
| + | |
− | <br>
| + | |
− | :{{Par2b|analyze|bool|false}}
| + | |
− | ::If ''true, ''this option will print out color statistics on the screen. There are maximum and minimum values for all channels. There is an average for all channels. There is a "loose maximum" and "loose minimum". The "loose" values are made to filter out very bright or very dark noise creating an artificially low or high minimum / maximum.
| + | |
− | <br>
| + | |
− | :{{Par2b|autowhite|bool|false}}
| + | |
− | ::If ''true, ''this option will use the information from the analyzer, and attempt to center the color offsets. If you have recorded some material, where the colors are shifted toward one color, this filter may help. But be careful - it isn't very intelligent - if your material is a clear blue sky, autowhite will make it completely grey! If you add "off_u" or "off_v" parameters at the same time as autowhite, they will not be used!
| + | |
− | <br>
| + | |
− | :{{Par2b|autogain|bool|false}}
| + | |
− | ::If ''true, ''this option will use the information from the analyzer, and attempt to create as good contrast as possible. That means, it will scale up the ''Y ''(luma) values to match the minimum and maximum values. This will make it act like an "autogain" setting on cameras, amplifying dark scenes very much, while leaving scenes with good contrast alone. Some places this is also refered to as "autolevels".
| + | |
− | <br>
| + | |
− | :{{Par2b|conditional|bool|false}}
| + | |
− | ::If ''false, ''this option will ignore any given conditional variables. See the [[#Conditional_Variables|Conditional Variables]] section for an overview of the conditional variables and their use with ColorYUV.
| + | |
− | | + | |
− | ==Parameter Scaling==
| + | |