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 27th December 2008, 01:56   #41  |  Link
mikeytown2
Resize Abuser
 
mikeytown2's Avatar
 
Join Date: Apr 2005
Location: Seattle, WA
Posts: 623
Try it after installing this

Microsoft Visual C++ 2005 Redistributable Package
http://www.microsoft.com/downloads/d...displaylang=en
mikeytown2 is offline   Reply With Quote
Old 27th December 2008, 14:49   #42  |  Link
zee944
Registered User
 
Join Date: Apr 2007
Posts: 240
Quote:
Originally Posted by mikeytown2 View Post
Try it after installing this

Microsoft Visual C++ 2005 Redistributable Package
http://www.microsoft.com/downloads/d...displaylang=en
This solved it. Thanks.
zee944 is offline   Reply With Quote
Old 17th April 2012, 19:34   #43  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
can anyone reupload the colorbalance dll somewhere? The original download link was dead
lansing is offline   Reply With Quote
Old 17th April 2012, 19:59   #44  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,433
This is the penultimate version (v0.25).
I believe the only difference in v0.26 was to change/correct the default value of the clone_gimp parameter (see post #38).
Attached Files
File Type: zip ColorBalance_0.25.zip (21.3 KB, 1100 views)
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline   Reply With Quote
Old 18th April 2012, 06:27   #45  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
12 hours since attachment posted and still no approval?
lansing is offline   Reply With Quote
Old 18th April 2012, 07:39   #46  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 712
You forgot the magic formula. "I downloaded this MKV from the internets", and the moderators come instantly.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding
cretindesalpes is offline   Reply With Quote
Old 19th April 2012, 00:34   #47  |  Link
Mounir
Registered User
 
Join Date: Nov 2006
Posts: 776
i don't understand the syntax, how do you use this filter??
edit: nevermind
Mounir is offline   Reply With Quote
Old 1st July 2013, 06:59   #48  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,589
Quote:
Originally Posted by Gavino View Post
This is the penultimate version (v0.25).
I believe the only difference in v0.26 was to change/correct the default value of the clone_gimp parameter (see post #38).
I found the v0.26 here
real.finder is offline   Reply With Quote
Old 16th November 2013, 21:30   #49  |  Link
BiOSsCZ
Registered User
 
Join Date: Jun 2008
Posts: 10
Hello,
Please, how to use this interesting plugin?
Can anyone help me?
BiOSsCZ is offline   Reply With Quote
Old 31st May 2015, 15:21   #50  |  Link
Bernardd
Registered User
 
Join Date: Jan 2012
Location: Toulon France
Posts: 249
Hello,

I search a coloryuv autogain function alternative. I have tried to write a script to get automatic white balance with StainlessS RGBAdapt plugin.
Some results were nice, but it is a problem of luma compressed range, that i do not know resolve now. I am now out my knowledge boundary. Thus
i have tried to get automatic white balance with ColorBalance plugin. With my RGBAdapt experiment, i can say now, which is efficiently.

This function need to load ColorBalance.dll, GRunt.dll and MaskTools2.dll. The function has two original ColorBalance args (keep_luma and clone_gimp)
If the output is not nice, the function has two special args. one to tune the the reference middle value. one to increase or decrease the range of midtones.
There are three technical args, one for color space conversion matrix choice, one to display calculated corrections and one to display tones masks.

Note : i do not know Cine paint vs Gimp theorical difference

Quote:
function ColorBalance_auto(clip, bool "keep_luma", bool "clone_gimp", string "matrix", int "midtones_value", \
string "midtones_size", bool "show_info", bool "show_masks")
{

#----------------------------------------------based on ColorBalance plugin -------------------------------------------------------------------#
# script authors : Gavino, Mikeytown2 http://forum.doom9.org/showpost.php?...1&postcount=44 #
#------------------------------------------------------------------------------------------------------------------------------------------------- #

#---------------------------------------------- need GRunT plugin ----------------------------------------------------------------------------#
# script author : Gavino http://forum.doom9.org/showthread.ph...83#post1157083 #
#----------------------------------------------------------------------------------------------------------------------------------------------- #

#---------------------------------------------- need masktools v2 plugin ----------------------------------------------------------------------------#
# script authors : Kurosu, Manao, mg262 http://forum.doom9.org/showthread.ph...83#post1157083 #
# fork http://avisynth.nl/index.php/MaskTools2 #
#----------------------------------------------------------------------------------------------------------------------------------------------- -------#

keep_luma = default(keep_luma, true) # (original plugin arg) Keep_luma corresponds to Gimp's 'Preserve Luminosity'.
# This option ensures that the brightness is maintained. The value of the brightest pixels are not changed.
clone_gimp = default(clone_gimp, true) # (original plugin arg) If set to false, ColorBalance will behave like CinePaint.
matrix = default (matrix, "Rec601") # Color standart conversion matrix "Rec601" , "PC601" , "Rec709", "PC709"
midtones_value = default (midtones_value, 128) # Between 0 and 255, default 128
midtones_size = default(midtones_size, "64->192") # midtones range "96 - 160" or "64 - 192" or "32 - 224" or "0 - 255"
show_info = Default(show_info, false) # show info or not, default false
show_masks = Default(show_masks, false) # show masks or not, default false

ScriptClip(clip, """

clip = last

#----------- Luma tones evidence

(!isYV12(clip)) ? ConvertToYV12(clip, matrix=matrix) : clip

shadows_mask = (midtones_size == "96->160") ? MT_Lut(clip,"x 96 <= 255 0 ?", y=3,u=1, v=1):\
((midtones_size == "64->192") ? MT_Lut(clip,"x 64 <= 255 0 ?", y=3,u=1, v=1):\
((midtones_size == "32->224") ? MT_Lut(clip,"x 32 <= 255 0 ?", y=3,u=1, v=1):\
MT_Lut(clip,"x 0 <= 255 0 ?", y=3,u=1, v=1)))

midtones_mask = (midtones_size == "96->160") ? MT_Lut(clip,"x 160 <= x 96 > & 255 0 ?", y=3,u=1, v=1):\
((midtones_size == "64->192") ? MT_Lut(clip,"x 192 <= x 64 > & 255 0 ?", y=3,u=1, v=1):\
((midtones_size == "32->224") ? MT_Lut(clip,"x 224 <= x 32 > & 255 0 ?", y=3,u=1, v=1):\
MT_Lut(clip,"x 255 <= x 0 > & 255 0 ?", y=3,u=1, v=1)))

highlights_mask = (midtones_size == "96->160") ? MT_Lut(clip,"x 160 > 255 0 ?", y=3,u=1, v=1):\
((midtones_size == "64->192") ? MT_Lut(clip,"x 192 > 255 0 ?", y=3,u=1, v=1):\
((midtones_size == "32->224") ? MT_Lut(clip,"x 224 > 255 0 ?", y=3,u=1, v=1):\
MT_Lut(clip,"x 225 > 255 0 ?", y=3,u=1, v=1)))

black = BlankClip(clip, color=$000000)

shadows = Overlay(clip,black, mask=shadows_mask, opacity=1.0, mode="blend")
midtones = Overlay(clip,black, mask=midtones_mask, opacity=1.0, mode="blend")
highlights = Overlay(clip,black, mask=highlights_mask, opacity=1.0, mode="blend")

#------------ Color matrix input


Kr = (matrix == "Rec601") ? 0.299 : ((matrix == "PC601") ? 0.229 : 0.2126)
Kg = (matrix == "Rec601") ? 0.587 : ((matrix == "PC601") ? 0.587 : 0.7152)
Kb = (matrix == "Rec601") ? 0.114 : ((matrix == "PC601") ? 0.114 : 0.0722)

#------------ YUV values extraction

(!isYV12(clip)) ? ConvertToYV12(clip, matrix=matrix) : clip

y_shadows = AverageLuma(shadows)
u_shadows = AverageChromaU(shadows)
v_shadows = AverageChromaV(shadows)

y_midtones = AverageLuma(midtones)
u_midtones = AverageChromaU(midtones)
v_midtones = AverageChromaV(midtones)

y_highlights = AverageLuma(highlights)
u_highlights = AverageChromaU(highlights)
v_highlights = AverageChromaV(highlights)

#------------ RGB values

r_shadows = y_shadows + 2*(v_shadows - midtones_value)*(1-Kr)
g_shadows = y_shadows - 2*(u_shadows - midtones_value)*(1-Kb)*Kb/Kg \
- 2*(v_shadows - midtones_value)*(1-Kr)*Kr/Kg
b_shadows = y_shadows + 2*(u_shadows - midtones_value)*(1-Kb)

r_midtones = y_midtones + 2*(v_midtones - midtones_value)*(1-Kr)
g_midtones = y_midtones - 2*(u_midtones - midtones_value)*(1-Kb)*Kb/Kg \
- 2*(v_midtones - midtones_value)*(1-Kr)*Kr/Kg
b_midtones = y_midtones + 2*(u_midtones - midtones_value)*(1-Kb)

r_highlights = y_highlights + 2*(v_highlights - midtones_value)*(1-Kr)
g_highlights = y_highlights - 2*(u_highlights - midtones_value)*(1-Kb)*Kb/Kg \
- 2*(v_highlights - midtones_value)*(1-Kr)*Kr/Kg
b_highlights = y_highlights + 2*(u_highlights - midtones_value)*(1-Kb)

#----------- RGB différence calcul

du_shadows = 128-u_shadows # in YUV range, correction is 128 subtract YUV channel value
dv_shadows = 128-v_shadows

dr_shadows = 2*dv_shadows*(1-Kr)
db_shadows = 2*du_shadows*(1-Kb)
dg_shadows = - 2*du_shadows*(1-Kb)*Kb/Kg - 2*dv_shadows*(1-Kr)*Kr/Kg

du_midtones = 128-u_midtones
dv_midtones = 128-v_midtones

dr_midtones = 2*dv_midtones*(1-Kr)
db_midtones = 2*du_midtones*(1-Kb)
dg_midtones = - 2*du_midtones*(1-Kb)*Kb/Kg - 2*dv_midtones*(1-Kr)*Kr/Kg

du_highlights = 128-u_highlights
dv_highlights = 128-v_highlights

dr_highlights = 2*dv_highlights*(1-Kr)
db_highlights = 2*du_highlights*(1-Kb)
dg_highlights = - 2*du_highlights*(1-Kb)*Kb/Kg - 2*dv_highlights*(1-Kr)*Kr/Kg

#----------- RGB corrections calcul

red_shadows = 100*dr_shadows/r_shadows
green_shadows = 100*dg_shadows/r_shadows
blue_shadows = 100*db_shadows/r_shadows

red_midtones = 100*dr_midtones/r_midtones
green_midtones = 100*dg_midtones/r_midtones
blue_midtones = 100*db_midtones/r_midtones

red_highlights = 100*dr_highlights/r_highlights
green_highlights = 100*dg_highlights/r_highlights
blue_highlights = 100*db_highlights/r_highlights

#-------- ColorBalance use

(!isYV12(clip)) ? clip : ConvertToRGB(clip, matrix=matrix)

ColorBalance(last, red_shadows, green_shadows, blue_shadows, \
red_midtones, green_midtones, blue_midtones, \
red_highlights, green_highlights, blue_highlights,\
keep_luma, clone_gimp,false)

#-------- displayed info or no

(!show_info)? last : \
last.Subtitle("RED" + " Midtones range : " + string(midtones_size)+\
"\nShadows Values : "+String(r_shadows)+ " Midtones Values : "+String(r_midtones)+" Highlights Values: "+String(r_highlights)+\
"\nShadows Values Diff : "+String(dr_shadows)+ " Shadows ColorBalance Corr : "+String(red_shadows)+\
"\nMidtones Values Diff : "+String(dr_shadows)+ " Midtones ColorBalance Corr : "+String(red_midtones)+\
"\nHighlightss Values Diff : "+String(dr_shadows)+ " Highlights ColorBalance Corre : "+String(red_highlights),\
y=40,lsp=20)\
.Subtitle("GREEN" +\
"\nShadows Values : "+String(g_shadows)+ " Midtones Values : "+String(g_midtones)+" Highlights Values: "+String(g_highlights)+\
"\nShadows Values Diff : "+String(dg_shadows)+ " Shadows ColorBalance Corr : "+String(green_shadows)+\
"\nMidtones Values Diff : "+String(dg_midtones)+ " Midtones ColorBalance Corr : "+String(green_midtones)+\
"\nHighlightss Values Diff : "+String(dg_highlights)+ " Highlights ColorBalance Corr : "+String(green_highlights),\
y=160,lsp=20)\
.Subtitle("Blue" +\
"\nShadows Values : "+String(b_shadows)+ " Midtones Values : "+String(b_midtones)+" Highlights Blue Values: "+String(b_highlights)+\
"\nShadows Values Diff : "+String(db_shadows)+ " Shadows ColorBalance Corr : "+String(blue_shadows)+\
"\nMidtones Values Diff : "+String(db_midtones)+ " Midtones ColorBalance Corr : "+String(blue_midtones)+\
"\nHighlightss Values Diff : "+String(db_highlights)+ " Highlights ColorBalance Corr : "+String(blue_highlights),\
y=280,lsp=20)

(!isYV12(clip)) ? last : ConvertToYV12(last, matrix=matrix)

(!show_masks)? last : StackHorizontal(shadows.Subtitle("Shadows"), midtones.Subtitle("Midtones"), highlights.Subtitle("highlights"))\
.BilinearResize( width(clip), height(clip))

return last """, args = "keep_luma, clone_gimp, matrix, midtones_value, midtones_size, show_info, show_masks")

(!show_masks)? last : BilinearResize( 3*width(clip), height(clip))
}

Last edited by Bernardd; 31st May 2015 at 15:29.
Bernardd 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 09:41.


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