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 7th July 2005, 21:52   #1  |  Link
joshbm
Registered User
 
joshbm's Avatar
 
Join Date: Jun 2003
Location: Land of the Noobs & the Home of the Brave
Posts: 349
"The Matrix" Look [while keeping skin tones]

I was wondering in AviSynth how I could make the green tones come out like the Matrix screenshot below:

[before]

[desired look]

Regards,
joshbm
__________________
Tired of waiting for video encodes? Get a totally new P4 Desktop Computer for FREE.

Last edited by joshbm; 8th July 2005 at 17:04.
joshbm is offline   Reply With Quote
Old 7th July 2005, 22:29   #2  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,293
Making the green tones is not the problem. Keeping the tones of the face is the problem, at least for my attempts
Wilbert is offline   Reply With Quote
Old 8th July 2005, 00:58   #3  |  Link
Soulhunter
Bored...
 
Soulhunter's Avatar
 
Join Date: Apr 2003
Location: Unknown
Posts: 2,812
Not really what you looking for, but...

Here is a "matrix style" filter Manao wrote for me!

Code:
function rec_add_horizontal_bar(clip c, int bar_height)
{
  h = height(c)
 
  bar = c.blankclip(height = bar_height)
  full_bar = bar.yv12lut(y=-255,u=-255,v=-255)
  null_bar = bar.yv12lut(y=-0,u=-0,v=-0)
  double_bar = stackvertical(full_bar, null_bar)
 
  result = h >= 2 * bar_height ? double_bar : double_bar.crop(0,0,0,h-2*bar_height)
 
  return h <= 2 * bar_height ? result : stackvertical(result, rec_add_horizontal_bar(c.crop(0,0,0,-2*bar_height), bar_height))
}


function matrix_style1(clip c, int bar_height, float strength, float strength_u, float strength_v)
{
  bar_height = default(bar_height, 2)
  strength = default(strength, 1.0)
  u_strength = default(strength_u, 1.0)
  v_strength = default(strength_v, 1.0)
 
  str = string(strength)
  str_u = string(u_strength)
  str_v = string(v_strength)
 
  deviation_str = "256 x 128 - 128 / abs " + str + " ^ 256 * -"
 
  deviation_u = "x 128 - y * " + str_u + " * 256 / 128 +"
  deviation_v = "x 128 - y * " + str_v + " * 256 / 128 +"
 
  deviation = c.yv12lut(yexpr = deviation_str, y = 3, u = 1, v = 1).lanczosresize(width(c) / 2, height(c) / 2)
  deviationuv = ytouv(deviation, deviation)
  light_bar = yv12lutxy(c, deviationuv, uexpr = deviation_u,  vexpr = deviation_v, y = 2, u = 3, v = 3)
 
  overshoot = c.yv12lut(yexpr = "x 255 / 1.1 ^ 255 *", u = -128, v = -128)
  dark_bar = yv12lutxy(overshoot, deviationuv, uexpr = deviation_u,  vexpr = deviation_v, y = 2, u = 3, v = 3)
 
  mask = c.rec_add_horizontal_bar(bar_height)
    
  return maskedmerge(light_bar, dark_bar, mask, y=3, u=3, v=3)
}


function matrix_style2(clip c, int bar_height, float strength, float overshoot)
{
  bar_height = default(bar_height, 2)
  strength = default(strength, 1.0)
  overshoot = default(overshoot, 1.2)
 
  str = string(strength)
  ovr = string(overshoot)
 
  deviation_str = "256 x 128 - 128 / abs " + str + " ^ 256 * -"
 
  deviationuv = c.yv12lut(uexpr = "x 128 - abs 2 *", vexpr = "x 128 - abs 2 * ", y=1, u=3, v=3)
  deviationuv = logic(deviationuv, deviationuv.swapuv(), mode = "max", y = 1, u = 3, v = 3)
  deviation = c.yv12lut(yexpr = deviation_str, y = 3, u = 1, v = 1).lanczosresize(width(c) / 2, height(c) / 2)
  deviationuv2 = ytouv(deviation, deviation)
  resultuv = yv12lutxy(deviationuv, deviationuv2, uexpr = "128 x y * 512 / -", vexpr = "128 x y * 512 / -", y = 1, u = 3, v = 3)
 
  light_bar = mergechroma(c, resultuv, 1)
  overshootc = c.yv12lut(yexpr = "x 255 / " + ovr + " ^ 255 *", u = -128, v = -128)
  dark_bar = mergechroma(overshootc, resultuv, 1)
 
  mask = c.rec_add_horizontal_bar(bar_height)
    
  return maskedmerge(light_bar, dark_bar, mask, y=3, u=3, v=3)
}
Bye
__________________

Visit my IRC channel
Soulhunter is offline   Reply With Quote
Old 8th July 2005, 04:46   #4  |  Link
joshbm
Registered User
 
joshbm's Avatar
 
Join Date: Jun 2003
Location: Land of the Noobs & the Home of the Brave
Posts: 349
Thanks Soulhunter, I may use that in a couple scenes,

Any suggestions on what filters/plugins to use? Because I REALLY need this, a client is asking for a video with a Matrix look to it and I'm in dire need of a method to do so.

Maybe, Wilbert, you could share your attempts and possibly come up with a solution to somewhat satisfy. And maybe someone has an idea of how we can keep the skins tones.

Regards,
joshbm
__________________
Tired of waiting for video encodes? Get a totally new P4 Desktop Computer for FREE.

Last edited by joshbm; 8th July 2005 at 05:13.
joshbm is offline   Reply With Quote
Old 8th July 2005, 07:20   #5  |  Link
joshbm
Registered User
 
joshbm's Avatar
 
Join Date: Jun 2003
Location: Land of the Noobs & the Home of the Brave
Posts: 349
What do you think of this?

Before and After

I think that my skin tones are so red that it looks fine when the filter is applied. Any other input?

Regards,
joshbm
__________________
Tired of waiting for video encodes? Get a totally new P4 Desktop Computer for FREE.

Last edited by joshbm; 8th July 2005 at 07:35.
joshbm is offline   Reply With Quote
Old 8th July 2005, 17:03   #6  |  Link
joshbm
Registered User
 
joshbm's Avatar
 
Join Date: Jun 2003
Location: Land of the Noobs & the Home of the Brave
Posts: 349
Anyone know how to get the Matrix look while preserving skin tones and other colors?

Regards,
joshbm
__________________
Tired of waiting for video encodes? Get a totally new P4 Desktop Computer for FREE.
joshbm is offline   Reply With Quote
Old 8th July 2005, 17:11   #7  |  Link
brabbudu
Registered User
 
brabbudu's Avatar
 
Join Date: Jul 2005
Posts: 11
matrix style

I think the problem of "colorizing" to green is due to the colorisation of high saturation colors. We can try to shift only the colors near to gray to mantain the normal appearence of skin etc.
I go try this ..
brabbudu is offline   Reply With Quote
Old 8th July 2005, 17:33   #8  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,293
Ok, here's my attempt:

the one of yesterday:


the one of today:


I will post the scripts later today, since i've to eat first

But i like the attempt of soulhunter more (but he should increase the green a bit)

Last edited by Wilbert; 8th July 2005 at 17:37.
Wilbert is offline   Reply With Quote
Old 8th July 2005, 18:01   #9  |  Link
Gurm
Registered User
 
Join Date: Jun 2004
Posts: 95
I personally think you should ramp down the skin tones BEFORE applying the green matrix-y filter, but that's my taste.
Gurm is offline   Reply With Quote
Old 8th July 2005, 18:05   #10  |  Link
joshbm
Registered User
 
joshbm's Avatar
 
Join Date: Jun 2003
Location: Land of the Noobs & the Home of the Brave
Posts: 349
That's what I did in my go at it.



Regards,
joshbm
__________________
Tired of waiting for video encodes? Get a totally new P4 Desktop Computer for FREE.

Last edited by joshbm; 8th July 2005 at 18:18.
joshbm is offline   Reply With Quote
Old 8th July 2005, 18:53   #11  |  Link
mg262
Clouded
 
mg262's Avatar
 
Join Date: Jul 2003
Location: Cambridge, UK
Posts: 1,148
@joshbm

Your attempt looks pretty good to me. I was going to suggest trying to mask out the stuff that you couldn't risk changing the colour of too much (especially skin) with a *gradated* mask and then changing the colour of the rest. I think that's equivalent to merging the original with a 'greenified version' using a weight that varies from pixel to pixel. (That may be what @Soulhunter has done... I'm not terribly good at reading scripts.) I'm not very good with complex scripts, or I'd try writing something like that myself...

The other thing I thought of is that it might be worth taking a scene from the matrix and throwing it into @trevlac's vectorscope to get an idea of exactly what colours it is made up of.
mg262 is offline   Reply With Quote
Old 8th July 2005, 19:16   #12  |  Link
Soulhunter
Bored...
 
Soulhunter's Avatar
 
Join Date: Apr 2003
Location: Unknown
Posts: 2,812
Quote:
Originally Posted by Wilbert

...but he should increase the green a bit
Well, you have to tweak/edit it to match the source...

Source:


Tweaked Filtering:


Filtering + Subtitles + Tweaking:


Bye
__________________

Visit my IRC channel

Last edited by Soulhunter; 8th July 2005 at 19:40.
Soulhunter is offline   Reply With Quote
Old 8th July 2005, 19:33   #13  |  Link
joshbm
Registered User
 
joshbm's Avatar
 
Join Date: Jun 2003
Location: Land of the Noobs & the Home of the Brave
Posts: 349
Any luck with your new filter brabbudu?

Regards,
joshbm
__________________
Tired of waiting for video encodes? Get a totally new P4 Desktop Computer for FREE.
joshbm is offline   Reply With Quote
Old 8th July 2005, 22:10   #14  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,293
@Soulhunter,

There's must be a chroma bug in one those filters somewhere (with those ugly horizontal lines as a result).
Wilbert is offline   Reply With Quote
Old 8th July 2005, 22:26   #15  |  Link
Backwoods
ReMember
 
Backwoods's Avatar
 
Join Date: Nov 2003
Posts: 416
Quote:
Originally Posted by Wilbert
@Soulhunter,

There's must be a chroma bug in one those filters somewhere (with those ugly horizontal lines as a result).
Aren't they supposed to be there? Either way I'd like to know how to get rid of it myself. The result look very good.

EDIT: damn these eyes!

Last edited by Backwoods; 9th July 2005 at 00:03.
Backwoods is offline   Reply With Quote
Old 8th July 2005, 22:42   #16  |  Link
mg262
Clouded
 
mg262's Avatar
 
Join Date: Jul 2003
Location: Cambridge, UK
Posts: 1,148
Quote:
Originally Posted by Backwoods
Either way I'd like to know how to get rid of myself.
Not until you've explained EDLs to me, you don't.

mergechroma( Blur(0,1) )

might do the fix the chroma weirdness. Or you could convert to YV12!
mg262 is offline   Reply With Quote
Old 8th July 2005, 22:50   #17  |  Link
Soulhunter
Bored...
 
Soulhunter's Avatar
 
Join Date: Apr 2003
Location: Unknown
Posts: 2,812
@ Wilbert

Nah, have a look @ the "rec_add_horizontal_bar" function... XD

It simulates this "scanline effect" from the intro of Matrix Reloaded !!!





Bye
__________________

Visit my IRC channel

Last edited by Soulhunter; 8th July 2005 at 22:58. Reason: Added pictures of the Marix Reloaded intro...
Soulhunter is offline   Reply With Quote
Old 12th July 2005, 09:14   #18  |  Link
brabbudu
Registered User
 
brabbudu's Avatar
 
Join Date: Jul 2005
Posts: 11
another matrix

Here i am!

This is my result :

[IMG]matrix0.JPG[/IMG]

i've applied this formula to Green:

green=green(1+(1-sqrt(sat/(lum+1))))

hence the most colorized areas will be those with low saturation and low luminance
Attached Images
 
brabbudu is offline   Reply With Quote
Old 12th July 2005, 14:59   #19  |  Link
joshbm
Registered User
 
joshbm's Avatar
 
Join Date: Jun 2003
Location: Land of the Noobs & the Home of the Brave
Posts: 349
A mod anyone? I wanna see the pic .
__________________
Tired of waiting for video encodes? Get a totally new P4 Desktop Computer for FREE.
joshbm is offline   Reply With Quote
Old 13th July 2005, 00:03   #20  |  Link
joshbm
Registered User
 
joshbm's Avatar
 
Join Date: Jun 2003
Location: Land of the Noobs & the Home of the Brave
Posts: 349
Oh Mod? Come out, come out where ever you are.
__________________
Tired of waiting for video encodes? Get a totally new P4 Desktop Computer for FREE.
joshbm is offline   Reply With Quote
Reply

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 21:46.


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