View Full Version : Is it possible to create noise/grain with a mask for larger image
Vitaliy Gorbatenko
9th January 2010, 13:24
Is it possible to create noise/grain with a mask for larger image?
Example:
ref=last
Killer(3)
FrFun7(1.5,2.5,1.5)
#
GradFunkMirror(1.32)
diff=mt_makediff(ref)
LSFmod(ss_x=1.5, ss_y=1.5, smode=3, strength=125, overshoot=1, undershoot=1)#FastLineDarkenMOD(strength=75, thinning=0)
limited_toon(level=32)
dehaloh()
EdgeCleaner(strength=16)
ref=diff.EdgeCleaner(strength=16)
nnedi2_rpow2(rfactor=2,cshift="spline36resize")
diff=ref.nnedi2_rpow2(rfactor=2,cshift="spline36resize")# Incorrect!!! Need to create grain from pattern ref!!! Since the larger picture of noise looks terrible =(
awarpsharp2(chroma=2, depth=2, blur=1, thresh=253)
awarpsharp2(chroma=2, depth=2, blur=1, thresh=253)
mt_adddiff(diff)
Didée
9th January 2010, 15:04
Is it possible to create noise/grain with a mask for larger image?
That's a question without a specific point. Could as well be "is it possible to build a machine?" Yes it's possible. No, it's not possible. You need to tell more clearly what/why/how you want to mask.
ref=diff.EdgeCleaner(strength=16)
Seems like a bad idea to me. "diff" should contain only noise. EdgeCleaner can not do anything useful to it. If it does anything at all, it is degrading the noise that you're going to add back later on.
diff=ref.nnedi2_rpow2(...
Seems also like a bad idea to me. Nnedi2 can not do any meaningful interpolation to noise. If you're lucky, it nnedi2 just uses fallback to bicubic interpolation. Less lucky, it actually uses nnedi interpolation, which will make the noise look strange. In combination with the unsuited EdgeCleaner before it (which may introduce unwanted "structures" into the noise), the chances get bigger that nnedi2 does snap-on to those structures, producing more strange noise.
Seems to me you don't really need any mask, but rather need more suited processing. What about some simple highpass condensing, instead of funky misfiltering?
ref=last
Killer(3)
FrFun7(1.5,2.5,1.5)
GradFunkMirror(1.32)
diff=mt_makediff(ref)
LSFmod(ss_x=1.5, ss_y=1.5, smode=3, strength=125, overshoot=1, undershoot=1)#FastLineDarkenMOD(strength=75, thinning=0)
limited_toon(level=32)
dehaloh()
EdgeCleaner(strength=16)
nnedi2_rpow2(rfactor=2,cshift="spline36resize")
diff2=diff.lanczosresize(width,height)
diff2rg11=diff2.removegrain(11,0)
diff2=diff2rg11.removegrain(20,0).mt_adddiff(mt_makediff(diff2,diff2rg11)),U=2,V=2)
awarpsharp2(chroma=2, depth=2, blur=1, thresh=253)
awarpsharp2(chroma=2, depth=2, blur=1, thresh=253)
mt_adddiff(diff2)
Vitaliy Gorbatenko
9th January 2010, 15:56
I did and said that the increase grain via nnedi - a bad idea.
The result of the you script looks bad .. I would like to completely re-create the noise instead of increasing it in size.
I want the size of inclusions of particles of noise, their depth, the distribution of the initial picture remained the same - and increased their number in the final. If I may say so ...
Didée
9th January 2010, 16:27
Then use inpainting (http://forum.doom9.org/showthread.php?t=133773).
***
Please don't tell "I already did say that" when in fact it was such a nebulous and unclear post. Either you have to be more clear from the start, or you must be prepaired to get such comments.
You didn't say "a bad idea". The script-comment says "Incorrect", which is something else. Using NNEDI2 on noise is not incorrect. It is just bad suited. And about the ill-suited EdgeCleaner you said nothing at all.
Oh, and of course it is nearly impossible to make any specific suggestions. Don't know what your source (or its noise) looks like, don't know what that Killer() function actually is doing, and so on ...
And while we're at unclear-ness, the naming of variables in your scrpit is also very confusing. First there's "ref=last" (i.e. the source), and "diff" is some difference. later there is "ref=diff.filter", obscuring the original menaing of "ref". And even later, it's "diff=ref.filter" again ...
It's technically fully valid, but it is just bad style. If you were writing "big scripts" in that way, things would become, erh, sort of interesting....
Vitaliy Gorbatenko
10th January 2010, 15:29
Sorry. I just did not know how to formulate the thought that would have been clear what I want to get.
As for the plug - I do not understand how to use it ..
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.