Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
1st February 2009, 18:14 | #1 | Link |
Registered User
Join Date: Apr 2007
Posts: 240
|
mt_lut problem / How luma is calculated in YV12?
I have a script in which I make the pixels black below luma 40 and over luma 230 with mt_lut:
Code:
LoadPlugin("E:\mt_masktools[2.0a30].dll") ImageReader("gradient-h.jpg") ConvertToYV12() unprocessed=last mt_lut(last,expr="x 0 >= x 40 <= & 0 x ?",U=2,V=2) # between luma 0 and 40, make it black mt_lut(last,expr="x 230 >= 0 x ?",U=2,V=2) # between luma 230 and 255, make it black # mt_lut(last,expr="x 40 >= x 90 <= & x 40 - 90 40 - / 90 * x ?",U=2,V=2) # mt_lut(last,expr="x 180 >= x 230 <= & 180 x 180 - 230 180 - / 180 * - x ?",U=2,V=2) StackVertical(unprocessed,last) Why? Shouldn't be the cutoff point at [40, 40, 40] and [230, 230, 230]? How can I fix it? How luma is converted from RGB to YV12? How an [29, 29, 29] RGB pixel becomes [40, 40, 40] in YV12? Is there a formula for that? |
|
|