|
en anglais :
Color adjustment:
If you at your capture, you will see that the colors will be a bit distorted. Shiny colors will be more shiny, dark colors will be more dark. The reason is the following: Normally YUV values are not mapped from 0 to 255 (PC range), but a limited range (TV range). This limited range is 16-236 for the luma component and 16-240 for the chroma component of the YUV signal. This has to be adjusted when necessary. You can do this with AviSynth v2.5 (I don't know how to do this with v2.08). You have to find the settings only once. For the next capture you can use the same values, provided you don't change them in the capture settings.
We will use the histogram the adjust the brightness and contrast. Since the histogram requires YV12, we add the following lines to the script:
ColorYUV(off_y=0, gain_y=0)
ConvertToYV12()
Histogram()
Open this script in VirtualdubMod. Right-click on the clip and select normal to enlarge the clip. You will see the clip with next to it the histogram. On the vertical axis the pixel range (0-255) is plotted, and on the horizontal axis the luminance is plotted. If you look closely you will see that the range 0-15 is brown (meaning invalid), the range 16-236 black (valid) and 237-255 brown (invalid). The histogram itself can be white (if it lies in the valid range 16-236) or yellow (if it lies in the invalid range).
Look up a part of a frame that is black (black borders for example, and write down the frame). If the histogram is yellow on that part, it means that we have to increase the luminance (i.e. brightness) till the histogram becomes white. If it is white we have to decrease the luminance just before it becomes yellow. Open the script editor (under tools), adjust the off_y and press F5 for previewing. The script becomes for example:
ColorYUV(off_y=-20, gain_y=0)
ConvertToYV12()
Histogram()
Look up a part of a frame which is very bright. Increase (or decrease if necessary) the gain_y to stretch the luminance till you can't increase it any further. The script becomes for example:
ColorYUV(off_y=-20, gain_y=64)
ConvertToYV12()
Histogram()
You will see that also the left boundary has moved (because it was about 16 instead of 0, and changing gain_y means multiplying). Go back to your original frame, and adjust it again. The script becomes for example:
ColorYUV(off_y=-28, gain_y=64)
ConvertToYV12()
Histogram()
Continue till you are satisfied. If you are done, it is time to adjust the saturation (i.e. colorness/chrominance). The options "cont_u" and "cont_v" depend the saturation in the following way:
cont_u = cont_v = - (1 - saturation) * 256
Example: saturation = 0.8 implies cont_u = cont_v = - 0.2 * 256 = - 51.2. Look up a frame which contains something very red or blue (for example clothes), or just look at the skin of people, and increase/decrease the saturation. The script becomes for example:
saturation = 0.8
cu = - (1-saturation)*256
ColorYUV(off_y=-28, gain_y=64, cont_u=cu, cont_v = cu)
To be sure that the luminance and chrominance lie in a valid range, set opt="coring" as an option in ColorYUV. Remove the histogram since we don't need it anymore.
saturation = 0.8
cu = - (1-saturation)*256
ColorYUV(off_y=-28, gain_y=64, cont_u=cu, cont_v = cu, opt="coring")
tu peux passer par traducteur automatique (Lycos ou autre) , sinon j'ai pas encore essayé, faut le faire un jour. Si qq'un fait plus simple ça m'interesse aussi.
|