PDA

View Full Version : Post-Processing to add grain


foxyshadis
8th January 2006, 00:40
I've tried various combinations of adding grain, blurring it around, sharpening, and so on through ffdshow and avisynth, and so far I haven't succeeded. I can successfully make it look like a nasty air capture, a 5th generation vhs tape, interference noise, and so on, but not make it really pleasing.

I know this topic has come up off and on, but I haven't seen definitive solutions, a few I've seen posted didn't really look much better than ffdshow's. I'm not even sure what I'm looking for. I was hoping someone could suggest some avisynth methods of adding grain, that run blazing fast, looks great, and hide too-smooth video, along with any minor ringing/blocking. I don't know if effective edge dithering or basing grain on full frame brightness, underlying pixels, or whatever would be more effective than random/gaussian distribution, I don't know enough about film theory.

FFdshow noise also has the weird property that it always reduces luma, never increases. I don't know if there's a good reason for that or not.

I know some people hate grain, those coming from a photographic background especially, but I don't want to have another thread arguing its merits. So does anyone have good ideas?

Didée
8th January 2006, 01:48
Don't know what to say right now ... until I (perhaps) find something useful to say, you might (also perhaps) play around with the noise factory (http://www.neuron2.net/board/viewtopic.php?t=720) (raw & old).

foxyshadis
8th January 2006, 02:20
Thanks! I forgot about that thread. I'll give it a try, and also see what I can tweak. I could most likely make my own filters (at least proof-of concept level) if I knew more of the theory behind how the eye percieves noise, grain, motion, and edges. Hmm, maybe a film board is a better place to ask than an encoding board.

Pookie
8th January 2006, 02:59
Hey Didée - What about a modification of your 'Spresso' function ?

#Requires Addgrain and MaskTools

function mocha(clip clp, int "limit", int "bias", int "AGmode")
{
limit = default( limit, 2 )
bias = default( bias, 25 )
AGmode = default( AGmode, 200 )


LIM1 = (limit>0) ? string( round(limit*100.0/bias-1.0) ) : string( round(100.0/bias) )
LIM2 = (limit<0) ? "1" : string(limit)
BIA = string(bias)

expr = (limit<0) ? "x y - abs "+LIM1+" < x x 1 x y - x y - abs / * - ?"
\ : "x y = x x "+LIM1+" + y < x "+LIM2+" + x "+LIM1+" - y > x "+LIM2+" - " \
+ "x 100 "+BIA+" - * y "+BIA+" * + 100 / ? ? ?"

yv12lutxy( clp, clp.addgrain(AGmode,0,0), expr, U=2,V=2)
}

And call it like:

mocha(4,25,300)

JarrettH
8th January 2006, 08:36
scanline effect under picture properties? ah worth a shot:cool: