View Full Version : How to achieve "film look" on PAL DV source
Pages :
1
2
3
4
[
5]
6
7
8
9
Backwoods
21st February 2005, 10:54
I've stumbled on this thread a little late but I was playing around with the methods listed on the original website (Photoshop method). For the most part it is a straight port of his method, except the green mask is toned down a bit and I merged the original base layer with the final result.
On the left is the "film" look and on the right is the original video. Xvid@Q5:
http://rapidshare.de/files/665159/Lizard_COMPARE_xvid.avi.html
Tomorrow I'll see how it looks on my TV and play around with the FPS. Also, I suck at Subtitle(), can anyone post a sample of a simple Subtitle line for showing text on the bottom right?
E-Male
21st February 2005, 20:57
nice effect, looks really good IMO
only thing i'd add would be addgrain with very mild settings
and please post your complete script/procedure
http://www.avisynth.org/Subtitle
maybe subtitle(text="abc", align=3)
Backwoods
21st February 2005, 21:19
First I captured footage from my HDR-FX1, saved a portion of my cousin's lizard eating in DGIndex, used this script to export BMPs from Virtual Dub: Mpeg2Source("00.d2v")
SeparateFields()
Lanczos4Resize(960,540)
Then applied the procedure listed @ http://www.dcs.gla.ac.uk/~jhw/filmy/ in Photoshop to each frame using the batch feature (I would post the action file, but not sure where it saves.)
Then this script was used to compare the two and lower the green a little bit in the "film" clip.
a=AVISource("Lizard_FILM.avi").crop(0,0,-480,0).RGBAdjust(1, .955, 1, 1, 0, 0, 0, 0).subtitle("FILM",-1,-1,0,900,"arial",30,$ffffff)
b=AVISource("Lizard_VIDEO.avi").crop(480,0,0,0).subtitle("VIDEO",-1,-1,0,900,"arial",30,$ffffff)
return StackHorizontal(a,b)
Now some of this was done after a night of drinking, so I'm sure I could have done some things differently and I'll hopefully figure that out today and tonight. Oh and another thing I'd like to figure out is ImageSource, another thing that escapes me. So I can import the series of BMPs instead of making a lossless AVI.
Originally posted by E-Male
http://www.avisynth.org/Subtitle
maybe subtitle(text="abc", align=3)
Yea I've read up on that and searched the forums, still not settling in for me. And that line gives an error. Sooner or later I'll get it(something simple like this escapes me sometimes). Thanks though.
E-Male
22nd February 2005, 03:00
ah, i see
didn't know photoshop does allow batch processing
my goal is to do everything in avisynth
since you understand that photoshop guide, would help me porting it by answering some questions?
Backwoods
22nd February 2005, 03:06
As best as I can, sure. I'm actually about to start trying the same method in AVISynth now.
EDIT: The procedure listed on that website can definitely be done in AVISynth...I think to the T. It might take me a bit to get it, have to learn all about Overlay() but I think it will work. And I'm sure it'll be MIGHTY slow. For now, I loaded up two AMP files with your plugin and they worked just like how they should.
E-Male
23rd February 2005, 04:23
i'll go through the guide step by step tomorrow (or when i have time)
i'll then post which steps will work in avisynth now and which will need new plug-ins
i'll also post which steps i don't undertsand
Backwoods
23rd February 2005, 04:49
Which features do you think AVISynth can't do? From what I can tell, all can be done. The only problem I see is when the image has to be converted to LAB color and effects applied to certain layers.
LoadPlugin("C:\Program Files\AviSynth 2.5\yea\DGDecode.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\yea\GiCoCU.dll")
Mpeg2Source("menu.d2v")
#base=Mpeg2Source("menu.d2v")
#FILM=Mpeg2Source("menu.d2v")
#Mpeg2Source("menu.d2v")
ConvertToRGB()
SeparateFields()
#FILM Layer
GiCoCU("C:\download\filmy.amp",photoshop=true)
#Sharpen & Gaussian Blur [Unsharp Mask on Luminance Layer + GB on A/B Channels]
#Contrast Layer 1 [Dup FILM layer - (70% blue, 10% green, 20% red) Opacity 20%]
#Highlight Layer [Dup FILM Layer - Gaussian Blur Radius 5 pixels Layer blend Screen, Opacity 52%]
#Detail Layer [Dup FILM layer - Highpass Radius 6 pixels Image/Adjust/Desaturate Layer blend Soft Light, opacity 30%]
#Color Cast [Fill with color cast choice; medium dark green or orange are good Layer blend Soft Light, Opacity 40%. Use lower opacity for less dramatic effect]
#Original Blend [Dup base (unmodified) layer. Layer blend normal, opacity 30%. Adjust this opacity to get a balance between contrast and smoothness.]
#Shadow Pull-up [Layer blend Lighten, Opacity 15% - Base Layer]
GiCoCU("C:\download\shadow.amp",photoshop=true)
#Highlight Pull-Down [Layer blend Lighten, Opacity 20% - Base Layer]
GiCoCU("C:\download\highlight.amp",photoshop=true)
#Contrast Layer 2 [Dup FILM Layer - Desaturate by 50% Layer blend Soft Light, Opacity 10%]
That is the script so far, just loading 2 AMP files and commenting on what else is needed. The use of Overlay and naming commands, then applying certain effects to them is still needed.
I've done an other test using PS and it came out pretty good I think, have to make a couple AVIs comparing again and output to TV. I'll post an Xvid of it tonight or tomorrow.
E-Male
23rd February 2005, 11:30
OK, here is mylist:
Original:
baselayer=dv.deinterlace...
not sure which deinterlacer, should be tested
also we have to convert to rgb
FILM Layer:
filmlayer=baselayer.gicocu....
i see no problem here
Sharpen and Grain:
filmlayer=filmlayer.limitedsharpen...
filmlayer=filmlayer.addgrain...
modified for avisynth, other filter can be used here aswell
also i skipped the chroma blurring for now
we need yuv colorspace here
Contrast Layer 1 :
contrastlayera=filmlayer.channelmixer...
AFAIK there is no channelmixer in avisynth
but it should be very easy to code
Highlight Layer:
highlightlayer=filmalyer.gaussianblur...
there is a gaussian blut plug-in
Detail Layer:
detaillayer=filmlayer.highpass...
detaillayer=detaillayer.tweak...
desaturatino can be done with tweak i suppose
for highpass filterign there is no plug-in i know off
but if seen it done in a script by subtracting a blurred image from the original
not sure if this is what we need here
Color Cast:
colorcast=blankclip....
not sure if this really needs an extra layer
EDIT:
rgblut should be able to do the same job
:EDIT
Original Blend:
no problem
Shadow Pull-up / Highlight Pull-Down
here we'd need LAB colorspace
EDIT:
i got some code in my test-app that looks good
i think i can implement processing of L-curves
:EDIT
Contrast Layer 2:
no problem
Illumination coloring layer:
don't knwo of a filter doing a "Gradient Map"
but i think i can code such a filter for yuv colorspace
Grain Layer:
no problem
addgrain should do the job in avisynth
For black and white [optional]:
no problem i think
then we just have to overlay everything properly
EDIT:
i found a site with algorithms for "lighten", "screen", ...
i think they'll be doable in rgblut
:EDIT
so, i'll wait for some comments now, before i start looking into coding the missing plug-ins
Backwoods
23rd February 2005, 21:00
Gaussian blur for AVISynth: http://forum.doom9.org/showthread.php?s=&threadid=88645
Unsharp Mask for AVISynth shouldn't be too hard for someone to code. I believe there is such a plugin for VDub.
Overlay can do lighten but I do not see screen, so screen would be needed.
LAB color I have no idea about.
The LAB color part was the only thing I saw as a problem, but like you mentioned: "then we just have to overlay everything properly." Scripting that would take me some trial and error but I'm confident in that.
By the looks of it, we have just about everything.
E-Male
23rd February 2005, 21:59
yep, that the gausian blur i meant
i think we don't have to use the same sharpener
lighten, but not softlighten
rgblut IMO is the best solution, fast and programabel
as long as the curve only manipulated tha L-channel the formulas aren't that hard, but i haven't testet it yet
3 plug-ins and some scripting to go, looks like we'll soon have a test version
Backwoods
24th February 2005, 09:31
Originally posted by E-Male
lighten, but not softlighten
rgblut IMO is the best solution, fast and programabel
I'll check out RGBlut tomorrow and work on the script also.
E-Male
24th February 2005, 09:43
i just noticed there is no rgblutxy
so i'll have to add the blending features to the plug-ins to do list
this might slow down things again
i daubt working on the script will be worth the effort as long as we don't have the plug-ins/functions for all teh steps
FredThompson
26th February 2005, 19:02
How about packaging GiCoCu with a readme and a page?
Dark-Cracker
26th February 2005, 20:25
you have an unsharp mask filter in the warpsharp.dll plugin if i right remember.
Backwoods
27th February 2005, 00:03
Originally posted by Dark-Cracker
you have an unsharp mask filter in the warpsharp.dll plugin if i right remember.
I tried that and the valves didn't seem to give the same effect as they did in Photoshop.
The script is coming along and I'm taking progress shots to compare to the same procedure in Photoshop. Hopefully by the middle of the week I'll have everything done that I can possibly do as of now.
E-Male
27th February 2005, 10:58
i know i'm lazy with readmes, i'll try to improve on that
why do we have to use the same sharpener as in photoshop
there are great sharpeners for avisynth, like limited sharpen
i think some modification of that script might be the best we can get
Backwoods
27th February 2005, 23:02
Sure some modification will have to be done, I was just going along with the original at first and we can always improve from there. Also I think using LimitedSharpen would make the script run slower. That is why I'd like to hold off on that for now.
E-Male
28th February 2005, 00:14
then warpsharp (one of them) should be the best for beginning
Backwoods
28th February 2005, 03:00
Original Video from HD cam
http://img227.exs.cx/img227/7879/lizardvideo3fg.th.jpg (http://img227.exs.cx/my.php?loc=img227&image=lizardvideo3fg.jpg)
Video processed frame by frame in Photoshop
http://img227.exs.cx/img227/2589/lizardfilmps9we.th.jpg (http://img227.exs.cx/my.php?loc=img227&image=lizardfilmps9we.jpg)
Video processed with AVISynth
http://img227.exs.cx/img227/6880/lizardfilmavs6ho.th.jpg (http://img227.exs.cx/my.php?loc=img227&image=lizardfilmavs6ho.jpg)
E-Male, I think we're there.
Script: LoadPlugin("C:\Program Files\AviSynth 2.5\yea\DGDecode.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\yea\Decomb521.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\yea\GiCoCU.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\yea\TweakColor.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\yea\FFT3DFilter.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\yea\WarpSharp.dll")
#LoadPlugin("C:\Program Files\AviSynth 2.5\yea\.dll")
BaseLayer=AVISource("Menu_VIDEO2.avi")
ColorLayer=ImageSource("c:\download\color_cast.bmp")
#FILM Layer
FILM=BaseLayer.ConvertToRGB24().GiCoCU("C:\download\filmy.amp",photoshop=true)
#Sharpen & Gaussian Blur [Unsharp Mask on Luminance Layer + GB on A/B Channels]
SG=FILM.ConvertToYUY2().unsharpmask(300,2,0).FFT3dFilter(plane=1,bt=1,sharpen=-5).FFT3dFilter(plane=2,bt=1,sharpen=-5)
#Contrast Layer 1 [Dup FILM layer - (70% blue, 10% green, 20% red) Opacity 20%]
CONT=SG.Levels(5, 1, 255,0, 255)
#Highlight Layer [Dup FILM Layer - Gaussian Blur Radius 5 pixels Layer blend Screen, Opacity 52%]
HIGH=FILM.Blur(1)
#Detail Layer [Dup FILM layer - Highpass Radius 6 pixels Image/Adjust/Desaturate Layer blend Soft Light, opacity 30%]
DETAIL=FILM.ConvertToYUY2().TweakColor(sat=.5)
#Color Cast [Fill with color cast choice; medium dark green or orange are good Layer blend Soft Light, Opacity 40%. Use lower opacity for less dramatic effect]
COLORCAST=ColorLayer.BicubicResize(720,540)
#Original Blend [Dup base (unmodified) layer. Layer blend normal, opacity 30%. Adjust this opacity to get a balance between contrast and smoothness.]
OBLEND=BaseLayer
#Shadow Pull-up [Layer blend Lighten, Opacity 15% - Base Layer]
SHADOW=BaseLayer.ConvertToRGB24.GiCoCU("C:\download\shadow.amp",photoshop=true)
#Highlight Pull-Down [Layer blend Lighten, Opacity 20% - Base Layer]
HIGHPD=BaseLayer.ConvertToRGB24.GiCoCU("C:\download\highlight.amp",photoshop=true)
#Contrast Layer 2 [Dup FILM Layer - Desaturate by 50% Layer blend Soft Light, Opacity 10%]
CONT2=SG.ConvertToYUY2().TweakColor(sat=.5)
#Return ()
a=Overlay(SG, CONT, mode="Blend", opacity=.4)
b=Overlay(a,HIGH, mode="Add", opacity=0.52)
c=Overlay(b, DETAIL, mode="SoftLight", opacity=.3)
d=Overlay(c, COLORCAST, mode="SoftLight", opacity=.15)
e=Overlay(d, OBLEND, mode="Blend", opacity=.3)
f=Overlay(e, SHADOW, mode="Lighten", opacity=0.15)
g=Overlay(f, HIGHPD, mode="Lighten", opacity=0.2)
h=Overlay(g, CONT2, mode="SoftLight", opacity=0.1)
Overlay(h, BaseLayer, mode="Blend", opacity=0.7)
I'm sure there are a couple methods that can be changed, but this what I can do quickly and have so far.
I couldn't get AVISynth's Tweak to work for me, so I used TweakColor, I rather not use FFT3DFilter but that came to mind when I had to apply blur to UV only. Not sure if it's doing what it's intended, but maybe someone else can help out before the time it taks me to figure some other methods out. Also I'm not sure if the CONT layer is doing what I want it to. Probably not.
I'm pretty satisfied with the result.
E-Male
28th February 2005, 13:49
looks pretty nice already
on
"#Sharpen & Gaussian Blur [Unsharp Mask on Luminance Layer + GB on A/B Channels]
SG=FILM.ConvertToYUY2().unsharpmask(300,2,0).FFT3dFilter(plane=1,bt=1,sharpen=-5).FFT3dFilter(plane=2,bt=1,sharpen=-5)"
try
"SG=FILM.ConvertToYUY2()
SG=mergeluma(s.unsharpmask(300,2,0))
SG=SG.VariableBlur(2, 2, 2, 3, 3, true, false, true)"
see
http://www.avisynth.org/Merge
http://forum.doom9.org/showthread.php?s=&threadid=88645
"#Contrast Layer 1 [Dup FILM layer - (70% blue, 10% green, 20% red) Opacity 20%]"
won't work without a channel-mixer plug-in which i yet have to write
"#Highlight Layer [Dup FILM Layer - Gaussian Blur Radius 5 pixels Layer blend Screen, Opacity 52%]"
could also be done with VariableBlur, not sure if i'll be better
"#Detail Layer [Dup FILM layer - Highpass Radius 6 pixels Image/Adjust/Desaturate Layer blend Soft Light, opacity 30%]
DETAIL=FILM.ConvertToYUY2().TweakColor(sat=.5)"
doesn't have the highpass filter
i've seen it done with subtracting a blurred version
try something like
"DETAIL=FILM.ConvertToYUY2()
DETAIL=DETAIL.subtract(DETAIL.VariableBlur(6, 6, 3, 3, 3, false, false, false))
DETAIL=DETAIL.TweakColor(sat=.5)""
for
"#Color Cast [Fill with color cast choice; medium dark green or orange are good Layer blend Soft Light, Opacity 40%. Use lower opacity for less dramatic effect]"
see
http://www.avisynth.org/BlankClip
"#Shadow Pull-up [Layer blend Lighten, Opacity 15% - Base Layer]"
and
"#Highlight Pull-Down [Layer blend Lighten, Opacity 20% - Base Layer]"
can't be done that way, because the cuves are for lab colorspace, not rgb
i'll do a L-curve plug-in
"Illumination coloring layer"
is missing
can be done with blankclip and overlay i think
"Grain Layer"
is missing aswell
could be done without an additional layer
by using addgrain on the result IMO
does "overlay" really supports all needed modes and do they work/look like in photoshop??
can you really just overlay images with different colorspaces?
still to do for me are these plug-ins:
channel-mixer & L-curve (& new overlay ?)
posssible improvements / modifications on the procedure:
do artefact removal before the film-look procedure
add grain after it with addgrain
try different sharpeners
.....
E-Male
28th February 2005, 15:09
channel-mixer plug-in
http://e-rels.dyndns.org/downloads/chanmix.rar
chanmix(float r, float g, float b)
Wilbert
28th February 2005, 15:15
It should be forbidden to release stuff without documentation :) What does channel-mixer do?
E-Male
28th February 2005, 15:40
i thought it was obviouse from the previouse posts and the photoshop guide
it creates a greyscale image from a rgb24 source, the 3 paramaters specify how much of each color-channel is used
gray = (red*r + green*g + blue*b) / (r+g+b)
i hope this resembles the photoshop feature well
E-Male
28th February 2005, 16:04
i just noticed that the "Illumination coloring layer" can be done with blankclip and overlay
so i'll focus on the other 2 plug-ins
i think i can finish them today
Backwoods
28th February 2005, 23:52
Originally posted by E-Male
"Illumination coloring layer"
is missing
can be done with blankclip and overlay i think
Personally I didn't care for that so I left it out when I did the method in Photoshop, if you could figure it out in AVISynth, that'd be good for others.
"Grain Layer"
is missing aswell
could be done without an additional layer
by using addgrain on the result IMO
Another I left out because I felt it wasn't needed and enough grain was made from the sharpening.
does "overlay" really supports all needed modes and do they work/look like in photoshop??
can you really just overlay images with different colorspaces?
I believe so,
still to do for me are these plug-ins:
channel-mixer & L-curve (& new overlay ?)
I'll try your plugin tonight.
posssible improvements / modifications on the procedure:
do artefact removal before the film-look procedure
add grain after it with addgrain
try different sharpeners
.....
I was thinking of a deblocker too, grain again I'm iffy on but I will try it in the script, and I'm pretty happy with the sharpener now but again there is always room to play around.
Also the blankclip and color I'll do tonight also.
As is though, the script emulates what I did in PS just about to the T. Anything from here on is improving on the original method, IMO.
Backwoods
1st March 2005, 01:20
This crashes VDub when advancing one frame when replacing DETAIL, AVISynth didn't know what DETAIL meant on that line:
DETAIL=FILM.ConvertToYUY2()
DETAIL=DETAIL.subtract(DETAIL.VariableBlur(6, 6, 3, 3, 3, false, false, false))
DETAIL=DETAIL.TweakColor(sat=.5)""
And can you give an example line for your channer mixer?
E-Male
1st March 2005, 06:01
please tell me the exact error msg, especially which line/column (if it's mentioned)
#Contrast Layer 1 [Dup FILM layer - (70% blue, 10% green, 20% red) Opacity 20%]
CONT=SG.chanmix(20,10,70)
Guest
13th March 2005, 01:10
Is the link down atm?
Great stuff you are doing E-Male!!
Tin2tin:)
E-Male
13th March 2005, 22:11
my pc didn't stay online over the weekend while i was away
soon i'll have a router that'll fix this
file should be up agai
Backwoods
14th March 2005, 06:28
Sony HD cam - Left Original, Right Filtered
http://img226.exs.cx/img226/8646/0101zx.jpg
Sony HD cam - Left Original, Right Filtered
http://img226.exs.cx/img226/3410/0207sw.jpg
Sony DV cam - Left Filtered, Right Original
http://img226.exs.cx/img226/472/0307fu.jpg
Changes:
Invert for Highpass
No gaussian blur (wasn't happy with the end result)
No blurring of UV channels (didn't seem to matter in the end)
Blankclip() instead of loading BMPs
Added some color values at the bottom of the script for reference
AddGrain (in script for whoever wants to use it)
ToDo:
Use Tweak instead of Tweak color.
What command would be for Saturation? Something so simple escapes me, but I can recreate this Photoshop method easily.
#[V2F] Video2Film
LoadPlugin("DGDecode.dll")
LoadPlugin("Decomb521.dll")
LoadPlugin("GiCoCU.dll")
LoadPlugin("TweakColor.dll")
LoadPlugin("FFT3DFilter.dll")
LoadPlugin("WarpSharp.dll")
LoadPlugin("AddGrain.dll")
LoadPlugin("Chanmix.dll")
BaseLayer=AVISource("...")#.FieldDeinterlace(blend=false).Lanczos4Resize(720,360)
BaseLayer=MPEG2Source("...")#.FieldDeinterlace(blend=false).Lanczos4Resize(720,360)
#FILM Layer
FILM=BaseLayer.ConvertToRGB24().GiCoCU("film.amp",photoshop=true)
#Sharpen & Gaussian Blur [Unsharp Mask on Luminance Layer + GB on A/B Channels]
SG=FILM.ConvertToYUY2().unsharpmask(400,2,0)
#Contrast Layer 1 [Dup FILM layer - (70% blue, 10% green, 20% red) Opacity 20%]
CONT=SG.ConvertToRGB24().Chanmix(20, 10, 70)
#Highlight Layer [Dup FILM Layer - Gaussian Blur Radius 5 pixels Layer blend Screen, Opacity 52%]
HIGH=FILM.Blur(1.5)
#Detail Layer [Dup FILM layer - Highpass Radius 6 pixels Image/Adjust/Desaturate Layer blend Soft Light, opacity 30%]
DETAIL=FILM.Invert().ConvertToYUY2().TweakColor(sat=.25)
#Color Cast [Fill with color cast choice; medium dark green or orange are good Layer blend Soft Light, Opacity 40%. Use lower opacity for less dramatic effect]
COLORCAST=BlankClip(width=720,height=360,color=$C0C0C0)
#Original Blend [Dup base (unmodified) layer. Layer blend normal, opacity 30%. Adjust this opacity to get a balance between contrast and smoothness.]
OBLEND=BaseLayer
#Shadow Pull-up [Layer blend Lighten, Opacity 15% - Base Layer]
SHADOW=BaseLayer.ConvertToRGB24.GiCoCU("shadow.amp",photoshop=true)
#Highlight Pull-Down [Layer blend Lighten, Opacity 20% - Base Layer]
HIGHPD=BaseLayer.ConvertToRGB24.GiCoCU("highlight.amp",photoshop=true)
#Contrast Layer 2 [Dup FILM Layer - Desaturate by 50% Layer blend Soft Light, Opacity 10%]
CONT2=SG.ConvertToYUY2().TweakColor(sat=.5)
a=Overlay(SG, CONT, mode="Blend", opacity=.2)
b=Overlay(a,HIGH, mode="Add", opacity=0.52)
c=Overlay(b, DETAIL, mode="SoftLight", opacity=.3)
d=Overlay(c, COLORCAST, mode="SoftLight", opacity=.3)
e=Overlay(d, OBLEND, mode="Blend", opacity=.3)
f=Overlay(e, SHADOW, mode="Lighten", opacity=0.15)
g=Overlay(f, HIGHPD, mode="Lighten", opacity=0.2)
h=Overlay(g, CONT2, mode="SoftLight", opacity=0.1)
LAST=Overlay(h, BaseLayer, mode="Blend", opacity=0.8)
FINAL=LAST.AddBorders(0,60,0,60)
Return(FINAL)
#ConvertToYV12()
#AddGrain(18,0,0)
#ColorCast Color Values
#blue,medium = 4F4FBD
#blue,dark = 03036B
#blue,pure = 0000FF
#green,medium = 2E703F,22AC1C
#grey,light = C0C0C0
#grey,dark = 808080
#orange,light = F7D6730
#purple, medium = AC4FBD
#red,light = FF4646
#red, medium = A60505
#red, dark = 890101
tin3tin
5th April 2005, 08:39
DVX-100A Gamma Curves Chart for inspiration:
Kino-eye (http://www.kino-eye.com/archives/2005/01/dvx100a_gamma_c.html)
Have fun,
Tin3tin
onesoul
16th April 2005, 14:39
Awesome work that is been done here, definitely worthy of going to avisynth shared functions.
E-Male
16th April 2005, 21:21
but not before it's finished
Backwoods
16th April 2005, 23:20
Using Overlay really kills the speed of this process. If that was sped up or if a plugin that can do Overlay faster is made, that would be very productive. Now it doesn't seem to matter what you do to each layer, the resolution, or such...it still runs about the same speed.
Since my last post I did a couple changes to the script. I'm always using it and playing with it, so maybe so I'll post that update. I rather have a speed increase to show off. Maybe I should look into MaskTools...don't know as of now.
Mug Funky
17th April 2005, 08:46
yv12lutxy may be what you need. the syntax is a brain-killer though (reverse polish i think it's called). easy when you get the hang of it though.
E-Male
17th April 2005, 12:04
that syntax isn't that hard once you got the basics
IIRC there are 2-3 plug-ins missing
i'll do that when i got time
i'll also look into a correct overlay function, that includes all the photoshop modes we need
let's see how fast/slow i can make it
joshbm
17th April 2005, 19:01
Instead of using overlay use merge:
function merge(clip a,clip b,float "opacity"){
opacity=default(opacity,0.5)
return a.MergeLuma(b,opacity).MergeChroma(b,opacity)
}
It is also faster than it's yv12overlay counterpart:
function yv12overlay(clip a,clip b,float "opacity")
{
aExp="x "+string(opacity)+" * y 1 "+string(opacity)+" - * +"
return yv12lutxy(a,b,yexpr=aExp,uexpr=aExp,vexpr=aExp)
}
Take a look at this thread for actual tested results:
http://forum.doom9.org/showthread.php?s=&threadid=82127
Regards,
joshbm
E-Male
17th April 2005, 19:23
erm, we don't need a simple 50:50 mix
we need different algos
Backwoods
17th April 2005, 22:26
-I'll look into merge, yv12overlay, and yv12lutxy today.
-Gaussian Blur is working with a script
-Need to see if it's possible to apply a filter to UV and not the Y channel without using FFT3DFilter
-Overlay's functions mimic Photoshop's exactly. Just with different names. I did comparisons.
Other than that, I forget what else I changed. I'll do some speed tests and post samples tonight or tomorrow. Thanks for the suggestions.
Didée
17th April 2005, 22:47
> we need different algos
... and you can put together just anything through yv12lutxy.
Backwoods:
You're doing 11 (eleven) Overlay()'s in a row. I can imagine speed is no big fun with that script.
Using LUTs from MaskTools would increase the speed quite a bit. Plus, the overlay of "colorcast" would not be needed, as it could be packed into the preceeding "detail" overlay.
BTW, you're generating three clips from "baselayer", and do ConvertToRGB24()all three times. One time would be enough:
> baselayer24 = baselayer.ConvertToRGB24()
> FILM=BaseLayer24.GiCoCU("film.amp",photoshop=true)
> SHADOW=BaseLayer24.GiCoCU("shadow.amp",photoshop=true)
> HIGHPD=BaseLayer24.GiCoCU("highlight.amp",photoshop=true)
In similar manner, you could avoid one of those FILM.ConvertToYUY2() that are done two times.
Overall, there are pretty much colorspace conversions going on. Cutting them down as far as possible, and doing all the processing with LUTs, speed should get in acceptable range.
If only you all would come up with some processing description more specific than "PhotoShop Filter XYZ" ... ;)
edit: only thing that can *not* be done with yv12lut/xy is that weird "Hardlight" overlay of Photoshop (with transporting luma over/underflows to the chroma planes), since "inter-plane" operations are not available.
I never understood why PS uses that weird sort of Hardlight'ing. Why not use a clean algo that floors down at 0 resp. 255 ...
For me it's a strange dogma that something is "right", only because Photoshop is doing somthing just as it does ;)
Backwoods
18th April 2005, 01:56
http://www.uploadhouse.com/images/838867510000.JPG (http://www.uploadhouse.com/)
Plain = Original footage resized (1440x1080 to 720x480)
V2F_TEST = Merge replacing Overlay (no algos)
V2F = Latest rendition of V2F
AVS in VDub to Xvid. (just for testing and speed check)
Just using Merge doesn't cut it quality wise and I don't know if I can get yv12lutxy. That stuff is a bit beyond me. There is a speed increase using Merge though, from 2-4fps (on and off) to 4-6fps (with 4 being constant with the occasional 6). Replacing the Overlay lines that use "Blend" with Merge give off the same effect with a slight speed increase.
I touched up the ConvertXXX lines (I didn't even think of that) and just changing them didn't seem to add to any speed up. It is still much cleaner to do it the way you suggested Didée.
I'll do more testing on...Wednesday? Going away tomorrow and maybe the next day.
WorBry
2nd September 2005, 23:34
E-male, or somebody,
I cant seem to get GiCoCu to work. For my avi source I'm using a 50fps HufYuv "master" file that was encoded from my Pal DV Type II footage using the following script:
avisource("E:\DV Type II Clip.avi")
ConvertToYUY2(interlaced=true)
ColorYUV(off_y=-16,gain_y=16) #luma shift correction for Sony DV codec
Assumebff()
mvbob()
LanczosResize(720,544)
Convolution3D(1,4,5,3,4,2.8,0)
RemoveGrain(mode=2)
I would now like to apply some curvature with a little sharpening to acheive more of a "film effect". I've taken a few frameshots (jpg) using VDub and opened them in Gimp 2.2. I've then constructed a suitable S-curve and saved it first as a Gimp file and then as a txt file. As I understand it, I should then be able to import the file into my AVS script using GiCoCu.dll as folows:
avisource("E:\HufYuv master clip.avi")
ConvertToRGB32()
GiCoCu("C:\......\.gimp-2.2\curves\Gimp Curve.txt")
ConvertToYUY2()
LimitedSharpen(Smode=1, strength=100)
However, all I get is this weird yellowish mosaic image (see attached png image). Any idea how to resolve this?
Thanks
Wilbert
2nd September 2005, 23:53
I don't see an attachment. Could you attach it as jpg, and post the contents of the curve.txt.
WorBry
3rd September 2005, 05:46
Sorry about that - I thought the image had uploaded. Anyway, here it is again as a jpg at half-sized resolution.
The test Gimp curve I created is nothing special, just a slight S-curve created in the RGB channel:
# GIMP Curves File
0 0 -1 -1 -1 -1 -1 -1 64 54 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 192 200 -1 -1 -1 -1 -1 -1 255 255
0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 255 255
0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 255 255
0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 255 255
0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 255 255
I also observed the same effect with a more complex Gimp curve posted by Mug Funky earlier in this thread:
# GIMP Curves File
-1 0 16 0 37 17 -1 -1 -1 -1 -1 0 -1 0 -1 0 128 127 -1 -1 -1 193 -1 221 -1 210 207 219 -1 241 -1 -1 255 235
0 0 -1 -1 -1 43 41 42 -1 53 -1 -1 -1 -1 -1 57 -1 39 -1 0 -1 0 -1 0 -1 204 211 226 -1 231 -1 -1 255 255
0 0 -1 -1 -1 -1 47 52 -1 61 -1 -1 -1 -1 -1 125 121 125 -1 -1 -1 -1 -1 -1 -1 210 215 231 -1 -1 -1 -1 255 255
0 0 -1 -1 -1 -1 40 39 -1 0 -1 0 -1 0 -1 0 127 132 -1 147 -1 -1 -1 -1 -1 207 -1 221 222 235 -1 -1 255 255
0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 255 255
So I really dont know what's going wrong.
E-Male
3rd September 2005, 13:35
please also post the original image
try a more simple script like
---------
avisource(..)
converttorgb24()
gicocu(..)
--------
also try a curve that changes nothing
also, what avisynth version do you use?
WorBry
3rd September 2005, 18:46
Thanks for replying E-Male,
please also post the original image
Original HufYuv frameshot attached below (half size res)
try a more simple script like
---------
avisource(..)
converttorgb24()
gicocu(..)
Same yellow mosaic image
also try a curve that changes nothing
Same result
also, what avisynth version do you use?
AVS 2.5.5
E-Male
3rd September 2005, 19:31
i'm waiting for the image to be aproved, but i must say i got no idea what's wrong
communist
6th September 2005, 14:52
Successfully used the posted script for several videos and I really like the results.
Thanks :)
WorBry
6th September 2005, 21:09
Yeah, its a shame I cant get GiCoCu to work. So instead I've turned to a method described in the below link that uses a AVS import of the Vdub Gradation Curves filter:
http://aqua-web.dyndns.org/avisynth_24p.php
Unfortunately, the filter cant read Gimp curves, but I've been busily compiling a collection of amp files created in Photoshop CS2 (while the trial lasts !) to suit different circumstances (low-light, backlit etc). The procedure for customizing the code string in the vd_gradation curves avsi script (as advised by the author of the above article) is as follows:
1. Open avi source in Vdub
2. Load and open VD Gradation Curves filter in VDub
3. Import custom amp file and select desired mode*
4. Save VD processing settings (File>Save Settings)
5. Open the vcf file in Notepad to reveal amp code string
6. Copy and paste string into vd_gradation curves.avsi and change mode as appropriate*
* Note:
Mode 0 = RGB only
Mode 1 = RGB + R/G/B
Mode 2 = RGB weighted
Mode 3 = RGB weighted + R/G/B
Mode 4 = no processing
Mode 5 = YUV
I was rather hoping that the "YUV" mode option (in beta version 1.21) would avoid the need to pre-convert to RGB32, but alas that is not the case. Also, the output is still RGB, which means further re-conversion to YUY2 or YV12 in order to use Limited Sharpen. Maybe further development of the filter will lead to a YUV compatible AVS plug-in that would avoid these color space conversions and so better preserve image quality. Gimp curve code support would be great too.
Still, the results are still pretty amazing
E-Male
7th September 2005, 07:27
the question is if yuv curves will work with for film look
i often heard people prefer hsv
i plan to go for gicocu v2 when avisynth 2.6 is out, but i don't know how many other things will have to be doen first
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.