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 October 2018, 16:11   #21  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 7,216
Here from Colors_RGB.avsi
https://forum.doom9.org/showthread.p...75#post1741775





Same from Wiki:- http://avisynth.nl/index.php?title=C...ets&oldid=3718
EDIT: Above link NOTE:- by clicking on the column header, the table will sort by that column.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 25th October 2018 at 16:20.
StainlessS is offline   Reply With Quote
Old 25th October 2018, 18:19   #22  |  Link
color
Registered User
 
color's Avatar
 
Join Date: May 2016
Posts: 128
Ah, I did have the requiered dll, but I didn't have Avisynth+, I thought I had that one but I got Avisynth 2.6, uninstalled and installed Avisynth+ and it worked like a charm. And it was so mutch easier now. Better system than I wanted at the beginning. It feels like magic.

Oh, and I wanted fix strength, I did edit my answer when I realised I forgott to answer, but it didn't update my post somehow.


I love it! Looks great! I am following the "traditional" tinting colors from kino that was avalible in the 30's. So I stick to my colors, but Its great that I can use the Colors_RGB.avsi also. The only thing I want to add is two colors, like the darker should be red and the lighter should be orange (like inferno should be). If its hard to fix its no problem. I'm happy you made my day so mutch easier.

From the script:



A little bit extreme but I want also something like this if its possible:

__________________
Automatic Colorization

Last edited by color; 25th October 2018 at 19:14.
color is offline   Reply With Quote
Old 26th October 2018, 08:10   #23  |  Link
magiblot
Eurobeat Fan
 
Join Date: Sep 2014
Posts: 97
Quote:
Originally Posted by color View Post
Ah, I did have the requiered dll, but I didn't have Avisynth+, I thought I had that one but I got Avisynth 2.6, uninstalled and installed Avisynth+ and it worked like a charm. And it was so mutch easier now. Better system than I wanted at the beginning. It feels like magic.
By installing AviSynth+ you have also solved the compatibility problem with my script. However, it won't work with the old AviSynth+ from avs-plus.net nor with the latest release r2728 by pinterf due to an error in Expr. It works out-of-the-box, for example, with the next-to-last release r2664 at https://github.com/pinterf/AviSynthP...s/tag/r2664-MT

Quote:
Originally Posted by color View Post

A little bit extreme but I want also something like this if its possible:

https://preview.ibb.co/gMKT1V/Kino-Script000006.png
It wouldn't be difficult at all to implement this into my filter but I'm very busy at the moment. I could try this weekend, but StainlessS will probably have already found a solution by then

Last edited by magiblot; 26th October 2018 at 08:30.
magiblot is offline   Reply With Quote
Old 26th October 2018, 08:40   #24  |  Link
color
Registered User
 
color's Avatar
 
Join Date: May 2016
Posts: 128
I hope they fix that in the next release of avisynth, btw, stupid question. I read a little bit about vaporsynth, might that work similar like avisynth or does it miss/not contain important scripts? I did got virtualdub to work in ubuntu and vaporsynth also, but not avisynth and not avisynth+. Well If I do a little bit more digging maybe.

I don't know but I tried yours also, I do like both, but StainlessS's (look att al the S) is a little bit easier.

Its a bit extreem, but I looked on how the dyed films had for colors and some colors are just not the same on both. Some where dyed film and after it was developed it was dyed again that only effected the dark parts. Not all but a few colors.
__________________
Automatic Colorization
color is offline   Reply With Quote
Old 26th October 2018, 09:04   #25  |  Link
magiblot
Eurobeat Fan
 
Join Date: Sep 2014
Posts: 97
Quote:
Originally Posted by color View Post
I hope they fix that in the next release of avisynth, btw, stupid question. I read a little bit about vaporsynth, might that work similar like avisynth or does it miss/not contain important scripts? I did got virtualdub to work in ubuntu and vaporsynth also, but not avisynth and not avisynth+. Well If I do a little bit more digging maybe.
I have barely used VapourSynth, so I can't give you advice on it. However, I managed to get AviSynth+ working on Linux. It worked for me when using the "-with-vc_redist" installer. That is, of course, using Wine. I do not remember doing any specific tweaks to get it working. Well, I also installed K-Lite Codec Pack just in case.

Also, make sure you are using the updated branch of VirtualDub called VirtualDub2: https://sourceforge.net/projects/vdfiltermod/
magiblot is offline   Reply With Quote
Old 26th October 2018, 10:18   #26  |  Link
color
Registered User
 
color's Avatar
 
Join Date: May 2016
Posts: 128
K-Lite Codec Pack works perfect, what "system" version do you use in Wine/PlayonLinux (sorry for the o.t.) I use VirtualDub2 (sadly does not want to export png frame serie, bug?) and a modified version of VirtualDub 1.10.4 with "large adress aware" for exporting 1080p or bigger. Both works in PlayonLinux. I will give it a try with the package "-with-vc_redist".
__________________
Automatic Colorization
color is offline   Reply With Quote
Old 26th October 2018, 20:01   #27  |  Link
magiblot
Eurobeat Fan
 
Join Date: Sep 2014
Posts: 97
Quote:
Originally Posted by color View Post
K-Lite Codec Pack works perfect, what "system" version do you use in Wine/PlayonLinux
Windows 7 64-bit. But I don't use PlayOnLinux, I just have AviSynth and friends installed on the default wineprefix. I don't think the trick is in these settings though -- we'll see how it goes after you try the installer I said.
magiblot is offline   Reply With Quote
Old 26th October 2018, 23:40   #28  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 7,216
Quote:
Originally Posted by magiblot View Post
It wouldn't be difficult at all to implement this into my filter but I'm very busy at the moment. I could try this weekend, but StainlessS will probably have already found a solution by then
Not ruddy likely, at least you seem to have some idea what you are doing (whereas I dont have a clue how to do that) so I'll wait along with Color to see what you come up with.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 27th October 2018, 00:19   #29  |  Link
magiblot
Eurobeat Fan
 
Join Date: Sep 2014
Posts: 97
Okay, I gave it a try, I don't know if this is what you are looking for. I made it as a separate function since I believe it does something very different.

Example:

Code:
#https://www.welovepuzzle.ro/81759/puzzle-grafika-vintage-1000-piese-53507.jpg
ImageSource("puzzle-grafika-vintage-1000-piese-53507.jpg",end=0)
margin = width/16
AddBorders(margin,0,margin,0,$191919)
Spline64Resize(2*width/3,2*height/3)
ConvertToY(matrix="Rec601")
HSLtint(hue=36, sat=1.0, hueRange=240, satRange=1.0)
ColorMask(0.15, $1A08B3)


Code:
# ColorMask rev. 20181027 by magiblot1
function ColorMask(clip c, float "threshold", int "color", bool "invert", string "matrix") {
    # Replaces part of the picture by a plain color, based on the source's brightness.
    # "threshold" is a float in the range [0 .. 1] that specifies the brightness
    # up to which the color mask is applied. It can be done the other way round
    # by setting invert=true. 0 stands for absolute dark and 1 for pure white.
    # "color" specifies the color to be applied, e.g. $000000 for black.
    # YUV sources are expected to be TV range, RGB full range.
    # Requires masktools2 and AviSynth+ by pinterf
    
    Assert(0 <= threshold <= 1, """ColorMask: "threshold" must be in the range [0.0 .. 1.0].""")
    Assert(c.BitsPerComponent == 8, "ColorMask: This filter does not support high bit depth.")

    invert = Default(invert, false)
    matrix = Default(matrix, c.Width() > 1100 || c.Height() > 600 ? "Rec709" : "Rec601")
    
    y = c.IsRGB() ? c.ConvertToY(matrix=matrix).ColorYUV(levels="TV->PC") : c.ConvertToY().ColorYUV(levels="TV->PC")
    mask = mt_lut(y, String(threshold*255)+" x > "+(invert ? "0 255" : "255 0")+" ?").mt_deflate(threshold*255)
    mask = c.IsRGB() ? mask.CombinePlanes("RGB","YYY",pixel_type="RGBP8") : mask.CombinePlanes("YUV","YYY",pixel_type="YUV444P8")
    
    color = BlankClip(c,pixel_type="RGB32",color=color)
    color = c.IsRGB() ? color.ConvertToPlanarRGB() : color.ConvertToYUV444(matrix=matrix)
    
    p = c.IsRGB() ? c.ConvertToPlanarRGB() : c.ConvertToYUV444()
    
    merged = mt_merge(p,color,mask,U=3,V=3)

    return c.IsRGB32() ? merged.ConvertToRGB32()
    \ :    c.IsRGB24() ? merged.ConvertToRGB24()
    \ :    merged
        
}

Last edited by magiblot; 28th October 2018 at 17:11.
magiblot is offline   Reply With Quote
Old 27th October 2018, 09:54   #30  |  Link
color
Registered User
 
color's Avatar
 
Join Date: May 2016
Posts: 128
I was trying to test this with a small clip, but I get "Input and output need to have the same number of planes".

EDIT: I did try out the latest Avisynth+ for another script later last night. So that might be why, just forgotten it...I will try the new one with the hotfix instead.

EDIT 2: I had to "LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins64\masktools2.dll")", but now I get this result with your script, wierd:

__________________
Automatic Colorization

Last edited by color; 27th October 2018 at 10:58.
color is offline   Reply With Quote
Old 27th October 2018, 16:22   #31  |  Link
magiblot
Eurobeat Fan
 
Join Date: Sep 2014
Posts: 97
Quote:
Originally Posted by color View Post
EDIT: I did try out the latest Avisynth+ for another script later last night. So that might be why, just forgotten it...I will try the new one with the hotfix instead.
EDIT: I updated the function in post #17, just set the parameter oldAvsPlus=false when using HSLTint.

The reason why is that r2728 changed the order of the parameters of Expr but also broke compatibility with my use case. It works with the hotfix build but Expr now expects processing settings in the order R-G-B, while it used the order G-B-R in older versions.

Last edited by magiblot; 27th October 2018 at 16:43.
magiblot is offline   Reply With Quote
Old 27th October 2018, 23:06   #32  |  Link
color
Registered User
 
color's Avatar
 
Join Date: May 2016
Posts: 128
Oh. I will. Thank you.

I got what I needed. Thank you both so mutch!
__________________
Automatic Colorization
color is offline   Reply With Quote
Reply

Tags
film tinting

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 18:37.


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