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 12th June 2009, 09:04   #1  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
Fast line darken on any color?

Line darken was there to make the image stand out more, or protect lines before using filters for smoothing. However in anime, the lineart are not usually colored in black, see this image here:



notice the separation line between the blue and red color in the middle, it's actually colored in a darken red, also see the lineart on the red clothes. These are areas that fastlinedarken could not pick up.

Is there any method to detect these lines and darken them by their color?
lansing is offline   Reply With Quote
Old 14th June 2009, 18:10   #2  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
Quote:
Originally Posted by tengo6dedos View Post
Hello, I dont know about darken lines by color but what tou got there is more of a chroma shift than a 3 tone
thanks, i'm aware of the chroma bleed too, but the topic isn't really about that. What I really want is to find a way to darken the other colored outline to make them solid, so that i'm not going to smooth them out when I run some denoising filters.
lansing is offline   Reply With Quote
Old 16th June 2009, 06:25   #3  |  Link
Vitaliy Gorbatenko
viterra
 
Join Date: Feb 2003
Location: St. Peterburg, Russia
Posts: 142
I use the mix from several scripts. One works better on the lines, the other small objects. And be sure to include the restriction.
Call like: limited_toon(24)
Attached Files
File Type: 7z toons.7z (1.5 KB, 150 views)
Vitaliy Gorbatenko is offline   Reply With Quote
Old 16th June 2009, 19:29   #4  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
Can you post up some example? Because all I get is the darken+sharpen of black line even with something as high as this
Code:
limited_toon(level=90,line=90)
And a small bug: I assumped you're using the new awarpsharp here? He has changed the name parameter "cm" to "chroma"
lansing is offline   Reply With Quote
Old 17th June 2009, 09:12   #5  |  Link
Vitaliy Gorbatenko
viterra
 
Join Date: Feb 2003
Location: St. Peterburg, Russia
Posts: 142
Yes, changed for new version of a awarpsharp, but in limited_toon i don't use it . Bad idea to call the script with the highest 'level'. Better to call him several times. To change the lines were equal.

Edit: I found a similar source .. The script is not working properly because the function Soothe does not correctly works. Need Another limiting function which you can specify an absolute change in pixel value.

Edit2: I do not know how this is correct, but my source has not a bad result is:

b=last
a=b.LSFmod(ss_x=1.5, ss_y=1.5, smode=3, strength=75, overshoot=1, undershoot=1)
a=a.linedarken_toon(warpdepth=0, sstrength=64).FastLineDarkenMOD2(thinning=0, strength=64)
b=b.LSFmod()
contra(b, a)

# Contra-sharpening: sharpen the denoised clip, but don't add more than what was removed previously.
# Here: A simple area-based version with relaxed restriction. The full version is more complicated.
#
function contra (clip denoised, clip original)
{
s = denoised.minblur(1,1) # Damp down remaining spots of the denoised clip.
allD = mt_makediff(original,denoised) # The difference achieved by the denoising.
ssD = mt_makediff(s,s.removegrain(11,-1)) # The difference of a simple kernel blur.
ssDD = ssD.repair(allD,1) # Limit the difference to the max of what the denoising removed locally.
ssDD = SSDD.mt_lutxy(ssD,"x 128 - abs y 128 - abs < x y ?") # abs(diff) after limiting may not be bigger than before.

denoised.mt_adddiff(ssDD,U=2,V=2) # Apply the limited difference. (Sharpening is just inverse blurring.)

return( last )
}

Last edited by Vitaliy Gorbatenko; 18th June 2009 at 07:09. Reason: new try
Vitaliy Gorbatenko is offline   Reply With Quote
Old 18th June 2009, 11:21   #6  |  Link
Vitaliy Gorbatenko
viterra
 
Join Date: Feb 2003
Location: St. Peterburg, Russia
Posts: 142
Script:

function lite_dark(clip src)
{
b=src
a=b.LSFmod(ss_x=1.5, ss_y=1.5, smode=3, strength=75, overshoot=1, undershoot=1)
a=a.linedarken_toon(warpdepth=0, sstrength=64).FastLineDarkenMOD2(thinning=0, strength=64)
b=b.LSFmod()
return contra(b, a)
}

mpeg2source("01.d2v", cpu2="oooooo", info=3)
colormatrix(interlaced=true, hints=true)
Bifrost()
TComb(mode=0,fthreshL=7,othreshL=7)
ivtced=animeivtc(mode=1,aa=0) #the upcoming aa=4 also leads to very good results
nnedipel=ivtced.nnedi2_rpow2(rfactor=4,cshift="spline36resize")
mvectors=ivtced.mvanalysemulti(refframes=3,overlap=4,pel=4,pelclip=nnedipel,idx=1)
ivtced.mvdegrainmulti(mvectors,pelclip=nnedipel,idx=1)
overshoot=1, undershoot=1)
lite_dark().lite_dark().lite_dark()
LSFmod()
EdgeCleaner(strength=32)
crop(8,0,-8,0)
Spline64Resize(768,576)
ediaa()

1.jpg - source; 2.jpg - result:
Attached Images
  
Vitaliy Gorbatenko is offline   Reply With Quote
Old 19th June 2009, 21:00   #7  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
hi Vitaliy, I think you should consider uploading the image to some online space such as imageshack.us, so we don't have to wait for the mod approval in order to see it.

Back to the topic, your sample image shows nothing except darkening of black lines, it does nothing on colored lines.
Can anyone give a help start on this?
lansing is offline   Reply With Quote
Old 20th June 2009, 20:10   #8  |  Link
Vitaliy Gorbatenko
viterra
 
Join Date: Feb 2003
Location: St. Peterburg, Russia
Posts: 142
I'm sorry =( Forgot about attach approval.
By the way, if you look at the source - it can be seen that there were black lines as there are none at all! And blackening of lines is not happening! Just darkening of COLOURED lines. Tracings of contours literally created out of nothing ..
Vitaliy Gorbatenko is offline   Reply With Quote
Reply

Tags
color, darken, line

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 23:07.


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