Log in

View Full Version : Grey Ramp (Gray)


Jawed
15th February 2011, 21:05
Produces a screen full of grey blocks covering the entire range from 0 to 255 luma, from bottom-left to top-right:

greyramp=blankclip(pixel_type="yv12",color_yuv=$008080,width=20,height=60)
greyramp=stackhorizontal(greyramp,greyramp.mt_lut("x 1 +"))
greyramp=stackhorizontal(greyramp,greyramp.mt_lut("x 2 +"))
greyramp=stackhorizontal(greyramp,greyramp.mt_lut("x 4 +"))
greyramp=stackhorizontal(greyramp,greyramp.mt_lut("x 8 +"))
greyramp=stackhorizontal(greyramp,greyramp.mt_lut("x 16 +"))
greyramp=stackvertical(greyramp.mt_lut("x 32 +"),greyramp)
greyramp=stackvertical(greyramp.mt_lut("x 64 +"),greyramp)
stackvertical(greyramp.mt_lut("x 128 +"),greyramp)

Useful when tweaking screen calibration.

Gavino
16th February 2011, 00:41
Gradients can be created more simply using mt_lutspa.
For example, your script can be replaced by:
BlankClip(pixel_type="YV12")
mt_lutspa(expr="32 x * floor 7 8 y * floor - 32 * +")
# floor(32*x) + 32*(7-floor(8*y))
(Note that the expression is independent of the clip dimensions, as x and y run from 0 to 1.)

Jawed
16th February 2011, 03:03
Thanks. Tomorrow I will update mask tools as mine doesn't have mt_lutspa :eek: