1Levels 2====== 3 4.. function:: Levels(clip clip[, float min_in, float max_in, float gamma=1.0, float min_out, float max_out, int[] planes=[0, 1, 2]]) 5 :module: std 6 7 Adjusts brightness, contrast, and gamma. 8 9 The range [*min_in*, *max_in*] is remapped into [*min_out*, *max_out*]. Note that the 10 range behavior is unintuitive for YUV float formats since the assumed range will be 11 0-1 even for the UV-planes. 12 13 For example, to convert from limited range YUV to full range (8 bit):: 14 15 clip = std.Levels(clip, min_in=16, max_in=235, min_out=0, max_out=255, planes=0) 16 clip = std.Levels(clip, min_in=16, max_in=240, min_out=0, max_out=255, planes=[1,2]) 17 18 The default value of *max_in* and *max_out* is the format's minimum and maximum 19 allowed values repsectively. Note that all input is clamped to the input range 20 to prevent out of range output. 21 22 .. warning:: 23 The default ranges are 0-1 for floating point formats. This may have an undesired 24 effect on YUV formats. 25 26 *clip* 27 Clip to process. It must have integer sample type and bit depth 28 between 8 and 16, or float sample type and bit depth of 32. If 29 there are any frames with other formats, an error will be 30 returned. 31 32 *gamma* 33 Controls the degree of non-linearity of the conversion. Values 34 greater than 1.0 brighten the output, while values less than 1.0 35 darken it. 36 37 *planes* 38 Specifies which planes will be processed. Any unprocessed planes 39 will be simply copied. 40