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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 25th September 2016, 05:12   #181  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,373
Quote:
Originally Posted by Floatingshed View Post
Still not right...

Simply limiting the maximum chroma/saturation helps a lot.

Code:
Limiter(0, 255, 128-12, 128+12)

Last edited by raffriff42; 16th March 2017 at 22:50. Reason: (fixed image link)
raffriff42 is offline   Reply With Quote
Old 25th September 2016, 05:30   #182  |  Link
MWilson
Registered User
 
Join Date: Mar 2016
Location: Arkansas
Posts: 95
Quote:
Originally Posted by raffriff42 View Post
Simply limiting the maximum chroma/saturation helps a lot.


Limiter had slipped my mind, that's going to come in handy!
__________________
ChromaJig
MWilson is offline   Reply With Quote
Old 25th September 2016, 19:01   #183  |  Link
TheFluff
Excessively jovial fellow
 
Join Date: Jun 2004
Location: rude
Posts: 1,100
I really wouldn't put too much effort into a filter that by definition gives essentially random results. Just sayin'
TheFluff is offline   Reply With Quote
Old 25th September 2016, 19:36   #184  |  Link
MWilson
Registered User
 
Join Date: Mar 2016
Location: Arkansas
Posts: 95
Quote:
Originally Posted by TheFluff View Post
I really wouldn't put too much effort into a filter that by definition gives essentially random results. Just sayin'
There are plenty of problems, but those problems seem to be fairly consistent. So I will have to disagree
__________________
ChromaJig
MWilson is offline   Reply With Quote
Old 25th September 2016, 20:55   #185  |  Link
AzraelNewtype
Registered User
 
AzraelNewtype's Avatar
 
Join Date: Oct 2007
Posts: 135
Quote:
Originally Posted by Floatingshed View Post
Oh, I don't expect miracles! Is this now working as it should? I have had so many stumbles with this I am not sure...
Other folks earlier in this thread seemed to be getting far better results.
The best results shown in this thread were from when the script was being used on clips that had chroma, and the script was buggy and reusing that information instead of purely the random noise that you're getting.
AzraelNewtype is offline   Reply With Quote
Old 25th September 2016, 21:29   #186  |  Link
MWilson
Registered User
 
Join Date: Mar 2016
Location: Arkansas
Posts: 95
Quote:
Originally Posted by AzraelNewtype View Post
The best results shown in this thread were from when the script was being used on clips that had chroma, and the script was buggy and reusing that information instead of purely the random noise that you're getting.
A) The images you're talking about are gone, and have been for months.

B) Random noise is going too far, if you don't like the results you have every right to say so. But it plain and simply isn't what you're describing.
__________________
ChromaJig
MWilson is offline   Reply With Quote
Old 25th September 2016, 21:53   #187  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by MWilson View Post
The only thing I can think of at the moment is to downscale before the script.

Try the following:
Code:
Y=Clip
Y.GaussResize(192,76).ChromaJig().GBlur(2).GaussResize(width(Y),height(Y))
MergeChroma(Y,Last)
Edit: I didn't even like the results of 1.5 and it will be replaced with the latest ASAP.
gblur need 3 and up (odd number)

do you use another GBlur?
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 25th September 2016, 21:57   #188  |  Link
TheFluff
Excessively jovial fellow
 
Join Date: Jun 2004
Location: rude
Posts: 1,100
No, seriously though, this particular bit of dumb has gone on for far too long. Your script is based on not just one, but a entire series of fundamental misunderstandings of the underlying technology (the most egregious ones being how measuring chromatic information actually works and what the frequency domain actually is). This has been pointed out to you several times already but still you persist in using the same method. This entire thread is one big tribute to the remarkable ability of the human perception to see what it wants to see. You're literally adding random colors (there is no correlation whatsoever between the information you're basing the colors on and the actual color of the object, so you're picking the colors at random - it's not even an educated guess) and when the almost correct shade happens to fall out of the slot machine for some important foreground object you claim that this is a success, never mind that literally everything else in the background is utter garbage and you get a whole truckload of bizarre artifacts to go along with it (hint: stop these dumb frequency domain operations already). The entire thing is nonsense that usually results in coloring the entire scene either vaguely orange or vaguely green. Just drop it.

Last edited by TheFluff; 25th September 2016 at 21:59.
TheFluff is offline   Reply With Quote
Old 25th September 2016, 22:01   #189  |  Link
MWilson
Registered User
 
Join Date: Mar 2016
Location: Arkansas
Posts: 95
Quote:
Originally Posted by real.finder View Post
gblur need 3 and up (odd number)

do you use another GBlur?
I most likely am. I'm away from my main computer so I can't give you the exact plugin (or version of ?). The idea is the same, I'd just go with whatever gives you the best results.
__________________
ChromaJig
MWilson is offline   Reply With Quote
Old 25th September 2016, 22:08   #190  |  Link
MWilson
Registered User
 
Join Date: Mar 2016
Location: Arkansas
Posts: 95
Quote:
Originally Posted by TheFluff View Post
Just drop it.
Exactly.
__________________
ChromaJig
MWilson is offline   Reply With Quote
Old 25th September 2016, 23:15   #191  |  Link
Navarre66
Registered User
 
Join Date: Mar 2013
Posts: 12
Neural Networks for colorization

Really to do this correctly you would need to use a neural network. There just isn't enough information there. In reality most stars were wearing green makeup in the black and white TV shows so you are never going to want to show the real colors anyway.

Here are a couple articles that seems to be much better results, but still has work to go.

http://tinyclouds.org/colorize/

https://techcrunch.com/2016/03/31/th...hite-pictures/

However I still wish you luck with this technique.

Navarre66
Navarre66 is offline   Reply With Quote
Old 25th September 2016, 23:26   #192  |  Link
MWilson
Registered User
 
Join Date: Mar 2016
Location: Arkansas
Posts: 95
Quote:
Originally Posted by Navarre66 View Post
Really to do this correctly you would need to use a neural network. There just isn't enough information there. In reality most stars were wearing green makeup in the black and white TV shows so you are never going to want to show the real colors anyway.

Here are a couple articles that seems to be much better results, but still has work to go.

http://tinyclouds.org/colorize/

https://techcrunch.com/2016/03/31/th...hite-pictures/

However I still wish you luck with this technique.

Navarre66
Thank you, and I agree about the neural network approach
__________________
ChromaJig
MWilson is offline   Reply With Quote
Old 27th September 2016, 06:32   #193  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by MWilson View Post
I most likely am. I'm away from my main computer so I can't give you the exact plugin (or version of ?).
I am waiting
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 27th September 2016, 10:03   #194  |  Link
RocketJet
Registered User
 
RocketJet's Avatar
 
Join Date: Feb 2008
Posts: 36
Quote:
Originally Posted by TheFluff View Post
No, seriously though, this particular bit of dumb has gone on for far too long. .
On the contrary, I find it works quite well for me. I have colorized a bunch of stuff, including Fireball XL5 and the B/W seasons of Superman. Bottom line, if you don't like, then don't use it. I like it.
RocketJet is offline   Reply With Quote
Old 27th September 2016, 18:46   #195  |  Link
color
Registered User
 
color's Avatar
 
Join Date: May 2016
Posts: 235
I think this works great on old movies. I do have to change the levels, contrast and brightness a bit on some scenes to make it work better. But the best result is when its outdoor, its the sky is blue and colors are great. Often the things that should be red becomes green, but I can live with that.

And about the off topic on colorization with learning, I would love to see this work somehow with avisynth, but I think its hard job and hard to do. But it looks awesome. Still I do like the ChromaJig and I do like it and its faster than other projects like:

http://people.cs.uchicago.edu/~larsson/colorization/
http://colorize.ttic.edu/

http://demos.algorithmia.com/colorize-photos/ (free to do one picture online but otherwise it cost)

https://github.com/satoshiiizuka/sig...6_colorization
http://colorize.dev.kaisou.misosi.ru/

https://github.com/Eiji-Kb/macacon
color is offline   Reply With Quote
Old 3rd October 2016, 18:31   #196  |  Link
color
Registered User
 
color's Avatar
 
Join Date: May 2016
Posts: 235
Floatingshed

I do try to change the levels to get the best "colors" when its not good colored., but mostly they are okey.

I did change the levels but I think it could be mutch better if you do it. I just did this in a few secounds:

Quote:
ImageSource("C:\where_ever\the_image.jpg").ConvertToYUY2(matrix="Rec601", interlaced=false)
Levels(0, 1.390, 191, 0, 170)
chromajig(1)
when merging the color/chroma(?) with the black and white image or movie then its so mutch better.

Quote:
B=(ImageSource("C:\where_ever\the_image.jpg"))
C=(ImageSource("C:\where_ever\the_image.jpg").Levels(0, 1.390, 191, 0, 170).chromajig(1))
Overlay(B, C.BicubicResize(B.Width, B.Height), mode="chroma")
The only problem I have is the green color that sometimes want to color the face.

Last edited by color; 3rd October 2016 at 20:12.
color is offline   Reply With Quote
Old 26th October 2016, 04:02   #197  |  Link
MWilson
Registered User
 
Join Date: Mar 2016
Location: Arkansas
Posts: 95
Code:
function cjb(clip v)
{
v=v.converttoyv12().greyscale()
v1=v.spline36resize(240,240)
y=v1.converttorgb()
y.pointresize(8,8)
invert()
pointresize(16,16)
chromajig()
blur(1,1)
invert()
swapuv()
temporalsoften(10,0,20)
spline36resize(width(y),height(y))
a=last
y.pointresize(32,32)
chromajig()
blur(1,1)
invert()
spline36resize(width(y),height(y))
b=last
y.pointresize(128,128)
chromajig()
blur(1,1)
invert()
swapuv()
spline36resize(width(y),height(y))
c=last

subtract(a,b)
subtract(last,c)
invert()
temporalsoften(10,0,25)
mergechroma(y.converttoyv12().greyscale(),last,.75)
coloryuv(autowhite=true)
hqdn3d(0,6,0,4.5)
spline36resize(width(v),height(v))
blur(1,1)
mergechroma(v,last)
return last
}

function cjc(clip y)
{
y=y.greyscale().converttoyv12()
a=y.cjb().invert().tweak(hue=-90).invert().invert("U").swapuv()
b=y.cjb()
merge(a,b)
return last
}
Edit: Removed some extra lines

This is giving me some promising results, as always adjust as necessary.

__________________
ChromaJig

Last edited by MWilson; 26th October 2016 at 04:33.
MWilson is offline   Reply With Quote
Old 6th November 2016, 11:22   #198  |  Link
MWilson
Registered User
 
Join Date: Mar 2016
Location: Arkansas
Posts: 95
Code:
function ChromaJig3 (clip y, float weight)
{
y=y
weight=Default (weight,1)
y.gaussresize(240,240)
blur(1,1)
blur(1,1)
blur(1,1)
gaussresize(120,120)
blur(1,1)
blur(1,1)
gaussresize(42,42)
blur(1,1)
blur(1,1)
blur(1,1)
blur(1,1)
blur(1,1)
chromajig()
swapuv()
invert()
gaussresize(width(y),height(y))
subtract(last,y.chromajig())
a=last
a.gaussresize(36,36).chromajig().gaussresize(width(y),height(y))
b=last
c=subtract(a,b).swapuv()
d=subtract(b,a)
subtract(c,d)
merge(a,last)
merge(c,last)
invert("V")
mergechroma(y,last)
mergechroma(last,d,.75)
mergechroma(y,last,weight)
}



function fcjig(clip y)
{
y=y.converttoyv12()
y
gaussresize(80,60)
converttoyv12()
y1=last
y1
chromajig3(1)
converttorgb()
invert("G")
converttoyv12()
invert("UV")
swapuv()
blur(1,1)
blur(1,1)
blur(1,1)
merge(y1.chromajig(),last)
bilinearresize(width(y),height(y))
subtract(last,y.greyscale())
tweak(hue=-90)
merge(y.chromajig(),last)
gaussresize(80,80)
blur(1,1)
blur(1,1)
bilinearresize(width(y),height(y))
mergechroma(y,last)
return last 
}


function chroma(clip v,float "Weight")
{
Weight= Default (Weight,.75)
v=v.greyscale().converttoyv12()
y=v.linearresize(240,240).greyscale()
y.fcjig()
mt_makediff(vtoY(),last.reduceby2(),u=3,v=3)
#chromajig3b()
invert()
coloryuv(autowhite=true)
linearresize(width(v),height(v))
mergechroma(v,last,Weight)
}
I know this could be shortened. If you don't have LinearResize, change it to whatever you tend to use

I hope you folks will enjoy it as much as I am.

You might want to use rgbadjust (Broken Record, I know). But it's fairly close from the get-go with everything I've tried.

Here's two short clips that haven't been corrected or graded, one is from a color source converted to greyscale, and one that was originally colorized and then converted to greyscale.




Usage:
Code:
Chroma()
Thanks folks!
__________________
ChromaJig

Last edited by MWilson; 6th November 2016 at 11:28.
MWilson is offline   Reply With Quote
Old 7th November 2016, 14:00   #199  |  Link
MWilson
Registered User
 
Join Date: Mar 2016
Location: Arkansas
Posts: 95
Code:
function fc1(clip v,float weight)

{# (c) MWilson, http://forum.doom9.org/showthread.php?t=173364

v=v.greyscale().converttoyv12()
af=v.defreq(fy=-.29,fx=.29,sharp=0,dx=.50,dy=.50,fy2=-.88,fx2=.88,dx2=.50,dy2=.50)
av=v.defreq(fy=-29,fx=29,sharp=0,dx=50,dy=50,fy2=-88,fx2=88,dx2=50,dy2=50)
ax=v.defreq(fy2=-88,fx2=88,sharp=0,dx2=50,dy2=50,fy=-58,fx=58,dx=0,dy=50)
a=mt_makediff(merge(af,av),v).converttorgb().converttoyv12()
m1=ytouv(av,a).converttoyv12().sincresize(width(v),height(v))
y2=ytouv(m1.invert(),av).converttoyv12().sincresize(width(v),height(v))
merge(m1,y2,.35)
converttoyv12(last)
coloryuv(autowhite=true)
tweak(sat=5,maxsat=59.5,interp=20)
merge(v.invert().converttoyv12(),last.converttoyv12())
converttorgb()
sb=showblue(last).invert()
sr=showred(last).invert()
sg=showgreen(last).invert()
mergergb(sb,sr,sg)
ConvertToYV12()
sx=last.converttorgb().invert("G").converttoyv12()
sy=last.converttoyv12()
mergechroma(sy,sx,.50).converttoyv12()
merge(last,v.invert().converttoyv12()).invert("UV").swapuv()
tweak(sat=7.5,maxsat=59.5,interp=20)
mergechroma(v.converttoyv12(),last,weight)
coloryuv(autowhite=true)
converttorgb24()

return last

}



function fc2(clip v)

{# (c) MWilson, http://forum.doom9.org/showthread.php?t=173364

v=v.greyscale().converttoyv12()
merge(v.invert().fc1(1).converttoyv12().coloryuv(cont_u=-128,cont_v=-128),v.fc1(1).converttoyv12())
converttoyv12()
tweak(sat=5,interp=32)
mergechroma(v,last.awarpsharp2(depth=48,chroma=4),.333)

return last

}



function chromajig(clip y)

{# (c) MWilson, http://forum.doom9.org/showthread.php?t=173364

y=y.greyscale().converttoyv12()
y1=y.gaussresize(72,48)
y1
fc2()
#hqdn3d(0,28,0,4.5)
gaussresize(width(y),height(y))
subtract(y.fc2(),last)
mergeluma(y)
return last
}


function cjbx(clip v)

{# (c) MWilson, http://forum.doom9.org/showthread.php?t=173364

v=v.converttoyv12().greyscale()
v1=v.spline36resize(240,240)
y=v1.converttorgb()
y.pointresize(8,8)
invert()
pointresize(16,16)
chromajig()
blur(1,1)
invert()
swapuv()
#temporalsoften(10,0,20)
spline36resize(width(y),height(y))

a=last

y.pointresize(32,32)
chromajig()
blur(1,1)
invert()
spline36resize(width(y),height(y))

b=last

y.pointresize(180,180)
chromajig()
blur(1,1)
invert()
swapuv()
spline36resize(width(y),height(y))

c=last

subtract(a,b)
subtract(last,c)
invert()
spline36resize(width(y),height(y))
mergechroma(y.converttoyv12().greyscale(),last,.75)
coloryuv(autowhite=true)
spline36resize(width(v),height(v))
blur(1,1)
mergechroma(v,last)
return last
}



function colorfox(clip y)
{# (c) MWilson, http://forum.doom9.org/showthread.php?t=173364
y=y.greyscale().converttoyv12()
y.cjbx()
a=last
c1=a.converttorgb()

r=showred(c1)
g=showgreen(c1)
b=showblue(c1)

c=merge(r,merge(g,b).invert())
m=merge(g,merge(r,b).invert())
ye=merge(b,merge(r,g).invert())

mergergb(ye,m,c)

subtract(last,c1)
converttoyv12()
invert("UV")
subtract(a,last)
swapuv()
}


function colorjig(clip v, float "Weight")
{# (c) MWilson, http://forum.doom9.org/showthread.php?t=173364
Weight= Default(Weight,1)
v=v.greyscale().converttoyv12()
b=v.greyscale().colorfox().tweak(hue=90).invert("UV").coloryuv(autowhite=true).invert("V").converttoyv12()

merge(b,b.chromajig())
coloryuv(autowhite=true)
mergechroma(v,last,Weight)
}

Usage:
Code:
ColorJig()
Edit: Quick Test using ColorJig().Autolevels()


Edit: Commented out HQDN3D and temporalsoften calls, it was painfully slow. Using a denoiser after the fact is really just about as good.
__________________
ChromaJig

Last edited by MWilson; 7th November 2016 at 15:35. Reason: Typo
MWilson is offline   Reply With Quote
Old 8th November 2016, 11:33   #200  |  Link
MWilson
Registered User
 
Join Date: Mar 2016
Location: Arkansas
Posts: 95
This one is very close as far as I can see. I apologize for the posts, I just had to get some stuff out there.

Code:
function cfcf2(clip y)
{
y=y.greyscale().converttoyv12().invert().turnleft()
a=y.cjbx().utoy()
b=y.invert().TurnLeft().cjbx().TurnRight().invert().utoy()
ytouv(a,b,y)
mergechroma(y,last,.45)
converttoyv12()
c=last
subtract(c,y.cjbx())
invert("UV")
medianblur(0,10,10)
mergechroma(c,last,.33)
turnright()
invert("Y")
return last
}




__________________
ChromaJig

Last edited by MWilson; 8th November 2016 at 11:51.
MWilson is offline   Reply With Quote
Reply

Tags
automated, color, colorization

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:19.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.