Log in

View Full Version : Adjusting contrast--TMPGEnc style?


mantis2k
25th February 2010, 23:21
Please can you tell me an Avisynth filter that can adjust contrast similar to TMPGEnc's Custom Colour Correction (basic settings: Contrast)?

mantis2k
25th February 2010, 23:53
I desperately need to know what is AviSynth's equivalent function to TMPGEnc's contrast, as it acts like a major sharpener!

Tweak(cont=0.9) doesn't even compare and must be a completely different kind of contrast control!

wonkey_monkey
25th February 2010, 23:58
Can you post a before and after from TMPGEnc?

mantis2k
26th February 2010, 00:03
http://www.rarekungfumovies.com/contrast.jpg

Guest
26th February 2010, 00:24
Tweak(cont=0.9) doesn't even compare and must be a completely different kind of contrast control! The parameter you chose REDUCES the contrast.

mantis2k
26th February 2010, 00:54
The parameter you chose REDUCES the contrast.
Sure! The value in TMPGEnc is positive, but the picture becomes darker, sharper and slightly more saturated. If there is an equivalent function in Avisynth then I would expect the value to be negative. Regardless of the mechanics, it would be nice to know what is going on in TMPGEnc.

Guest
26th February 2010, 01:00
Try reading the Tweak documentation!

Cont: (0.0 to 10.0, default 1.0) is used to change the contrast of the image. Values above 1.0 increase the contrast. Values below 1.0 decrease the contrast.

mantis2k
26th February 2010, 07:57
Try reading the Tweak documentation!
I take it you are assuming TMPGEnc works the same way?

Alex_ander
26th February 2010, 09:32
Tweak(cont=...) does exactly the thing known as 'contrast' adjustment. Contrast of an image (or its detail) means relashionship between highest/lowest levels in the whole image (or in a part of it). If you get something different with TMPG, then it possibly changes something else (like simultaneously changing black level=brightness in the opposite direction or gamma~differently changing detail contrast in different level ranges, etc.). To see what it actually does you can try to achieve the same effect with ColorMill VDub filter which has more flexible controls than Tweak(), then import the final settings of that filter into AviSynth.

Guest
26th February 2010, 17:14
I take it you are assuming TMPGEnc works the same way? Why would you take it that way? You originally asked:

Please can you tell me an Avisynth filter that can adjust contrast similar to TMPGEnc's Custom Colour Correction (basic settings: Contrast)? I told you Tweak is one such filter and I corrected your erroneous use of it and explained the right way.

Can you post screenshots from the original, from Tweak (used correctly), and from TMPGEnc, so we can see what difference there really is?

mantis2k
26th February 2010, 21:45
Original
http://www.rarekungfumovies.com/original.jpg

Tweak(cont=1.5)
http://www.rarekungfumovies.com/tweak15.jpg

Tweak(cont=0.7)
http://www.rarekungfumovies.com/tweak07.jpg

TMPGEnc (Contrast = 80)
http://www.rarekungfumovies.com/tmpg.jpg

poisondeathray
26th February 2010, 22:05
avisynth (and tweak filter) is still working in Y'CbCr colorspace (unless you converttorgb and use filters in RGB); TMPGEnc like vdub does a colorspace conversion to RGB when using filters

If you want a similar effect to your screenshot in TMPGEnc, just do a levels conversion (or use Lato's smoothlevels, which will dither gradients)

Just by doing a rough eyeball comparison and looking at the histogram values
levels(30,1,235,0,255,coring=true)

also, you didn't specify coring=false, so values less than 16 or greater than 235 get clipped (this is what your screenshot from TMPGEnc showed as well)

I'm not suggesting you use the values above, because you've clipped blacks (lost detail) with those values.

But I am suggesting you look at histogram while you are doing this, to guide you , so you know what input black/white values do

original with levels adj + histogram
http://i49.tinypic.com/2yxk8rq.jpg

tmpg with histogram
http://i46.tinypic.com/30c3wn8.png

Didée
26th February 2010, 22:27
Also, the meaning of "contrast adjusment" is not really well-defined. It simply means to alter the difference between black level and white level. How this is to be done exactly, that is not carved in stone.

(a) you can fix the blackpoint, and adjust the whitepoint. This is a sort of contrast adjustment.

(b) you can fix the whitepoint, and adjust the blackpoint. This is a sort of contrast adjustment.

(c) you can fix an intermediate point (e.g. luma=128, or any other one if you like), and adjust the black- and whitepoint simultaneously. This is a sort of contrast adjustment.


Method (a) probably is the one that you'll find most often out there in the wild. But it's not a natural law.


edit ...

Avisynth's "Tweak()" uses method (a) for contrast.
After a minute of playing with the posted screenshots, I'm fairly confident that TMPEnc uses method (c), centered at luma=128.

Guest
26th February 2010, 22:30
Try this:

tweak(cont=1.3,bright=-30,sat=1.4)

I pull down the brightness to avoid blowing out whites. Of course sat increases the color saturation.

mantis2k
26th February 2010, 22:48
levels(30,1,235,0,255,coring=true)
Try this:

tweak(cont=1.3,bright=-30,sat=1.4)

I pull down the brightness to avoid blowing out whites. Of course sat increases the color saturation.
Many thanks, guys! Both of those come pretty close to what I got in TMPGEnc... so I guess you've nailed it! ;)

Thanks to Stainless, I've also improved the quality of the original, so will get even better results by the time I finished with the contrast.

StainlessS
26th February 2010, 23:06
Avisynth's "Tweak()" uses method (a) for contrast.
After a minute of playing with the posted screenshots, I'm fairly confident that TMPEnc uses method (c), centered at luma=128.

TMPGenc does use contrast from centre as suggested
but also has Base 0 and Base 1 contrasts in the drop down menu called 'Mode'. :)

EDIT:-

TMPGenc Custom Color Correction:-

In the TYPE settings:
Basic Setting
RGB
YUV
CMYK
HSV

In MODE Setting:
Basic Setting
Brightness
Contrast
Gamma Correction
Saturation
Hue
Dark Emphasis
Contrast (0 base)
Contrast (1 base)
Descale CCIR601
Extend to 0 - 255
Min Limit
Max Limit
Clip Low / High of Lum

Sliders vary depending on TYPE and MODE selected.
Multiple corrections can be applied consecutively, by clicking
the add button.