GreyScale

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
m (added category)
(formatting, links, phrasing)
Line 1: Line 1:
 +
Converts the input clip to greyscale (no color), without changing the color [[Convert|format]].
 +
 +
 
{{Template:FuncDef|Greyscale(clip ''clip'' [, string ''matrix''])}}
 
{{Template:FuncDef|Greyscale(clip ''clip'' [, string ''matrix''])}}
  
Converts the input clip to greyscale (without changing the color format).
+
:{{Par2|matrix|string|"Rec601"}}
 +
::Controls the colour coefficients used in RGB→greyscale conversion. 
 +
::*"Rec601" : Use Rec.601 coefficients.
 +
::*"Rec709" : Use Rec.709 coefficients.
 +
::*"AVERAGE" : Use averaged coefficients (''Y'' = (R + G + B) / 3).
 +
 
 +
 
 +
If {{FuncArg|clip}} is [[YUV]], the chroma channels are simply set to grey (128) – {{FuncArg|matrix}} is not used '''and must be empty'''.
 +
 
 +
See [[Color conversions]] for an explanation of the coefficients. Broadly speaking though,
 +
:*using ''Rec709'', '''green''' contributes more to the output, compared to the default Rec601;
 +
:*using ''Average'', '''blue''' contributes more.
  
In YCbCr based formats (YUY2, YV12), the chroma channels are set to 128. In RGB based formats, the conversion produces the luma using the coefficients given in the ''matrix'' parameter (rec601 by default, which reflects the behaviour in old AviSynth versions). This option is added in v2.56. When setting ''matrix''="rec709", the clip is converted to greyscale using Rec.709 coefficients. When setting ''matrix''="Average" the luma is calculated as (R+G+B)/3. See [[Color conversions]] for an explanation of these coefficients.
+
In all cases, Luma range is not changed (0-255 in → 0-255 out; 16-235 in → 16-235 out)
  
 
[[Category:Internal filters]]
 
[[Category:Internal filters]]
 
[[Category:Levels_and_Chroma_filters]]
 
[[Category:Levels_and_Chroma_filters]]

Revision as of 02:58, 17 January 2016

Converts the input clip to greyscale (no color), without changing the color format.


Greyscale(clip clip [, string matrix])

string  matrix = "Rec601"
Controls the colour coefficients used in RGB→greyscale conversion.
  • "Rec601" : Use Rec.601 coefficients.
  • "Rec709" : Use Rec.709 coefficients.
  • "AVERAGE" : Use averaged coefficients (Y = (R + G + B) / 3).


If clip is YUV, the chroma channels are simply set to grey (128) – matrix is not used and must be empty.

See Color conversions for an explanation of the coefficients. Broadly speaking though,

  • using Rec709, green contributes more to the output, compared to the default Rec601;
  • using Average, blue contributes more.

In all cases, Luma range is not changed (0-255 in → 0-255 out; 16-235 in → 16-235 out)

Personal tools