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. |
![]() |
#1 | Link |
Registered User
Join Date: May 2022
Location: Brazil
Posts: 36
|
Remove antialiasing from Subtitle
I'm trying to do an simulation of analog test text on-screen, but there's a problem:
I need to remove the antialiasing from the text, but i don't know how. Can you guys help me? Code:
ColorBars(width=640,height=480,pixel_type="YUV444").ChangeFPS("ntsc_double") text = BlankClip(last, pixel_type="YV24", color=$000000, width=(StrLen("01:00:58:00")*13)*2, height=20*2).ChangeFPS(FrameRate(last)/2) text = text.ShowSMPTE(offset="01:01:00:00",font="VCR OSD Mono",text_color=$FFFFFF,halo_color=$FFFFFFFF,size=21*2,y=18*2) text = text.ChangeFPS(FrameRate(text)*2) #text SeparateFields() text = text.SeparateFields() Overlay(last,text,x=(width()/2)-(width(text)/2),y=height()-48) Weave() LanczosResize(720,height()) ![]() |
![]() |
![]() |
![]() |
#2 | Link |
Big Bit Savings Now !
Join Date: Feb 2007
Location: close to the wall
Posts: 1,406
|
ShowSMPTE() is based on Subtitle(), and yes, Subtitle() renders with antialiasing out of the box.
Maybe this Avisynth internal filter could be recompiled to make antialiasing switchable, but can also be that the underlying function CreateFont() (Visual C++) already has this baked in ?
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain) "Data reduction ? Yep, Sir. We're working on that issue. Synce invntoin uf lingöage..." Last edited by Emulgator; 20th December 2022 at 18:57. |
![]() |
![]() |
![]() |
#3 | Link |
Registered User
Join Date: Jul 2018
Posts: 988
|
To skip most of AA you can rasterize in higher size (like 3..10x larger) and PointResize() to required output size.
Something like Code:
text = text.PointResize(text.width*10, text.height*10) text = text.ShowSMPTE(offset="01:01:00:00",font="VCR OSD Mono",text_color=$FFFFFF,halo_color=$FFFFFFFF,size=21*2*10,y=18*2*10) text = text.PointResize(text.width/10, text.height/10) Last edited by DTL; 20th December 2022 at 19:41. |
![]() |
![]() |
![]() |
#5 | Link |
Formerly davidh*****
Join Date: Jan 2004
Posts: 2,467
|
That's no guarantee though - you still might end up with grey pixels. You could add this expr on it before downscaling:
Code:
expr("x 128 > 255 0 ?", "128", "128") |
![]() |
![]() |
![]() |
#6 | Link |
Big Bit Savings Now !
Join Date: Feb 2007
Location: close to the wall
Posts: 1,406
|
Yes, these suggestions together work beautifully.
Only the last LanczosResize has to go, because it introduces grey pixels again. Code:
ColorBars(width=640,height=480,pixel_type="YUV444").ChangeFPS("ntsc_double") text = BlankClip(last, pixel_type="YV24", color=$000000, width=(StrLen("01:00:58:00")*13)*2, height=20*2).ChangeFPS(FrameRate(last)/2) text = text.PointResize(text.width*10, text.height*10) text = text.ShowSMPTE(offset="01:01:00:00",font="VCR OSD Mono",text_color=$FFFFFF,halo_color=$FFFFFFFF,size=21*2*10,y=18*2*10) text = text.expr("x 128 > 255 0 ?", "128", "128") text = text.PointResize(text.width/10, text.height/10) #text = text.ShowSMPTE(offset="01:01:00:00",font="VCR OSD Mono",text_color=$FFFFFF,halo_color=$FFFFFFFF,size=21*2,y=18*2) text = text.ChangeFPS(FrameRate(text)*2) #text SeparateFields() text = text.SeparateFields() Overlay(last,text,x=(width()/2)-(width(text)/2),y=height()-48) Weave() #LanczosResize(720,height())
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain) "Data reduction ? Yep, Sir. We're working on that issue. Synce invntoin uf lingöage..." |
![]() |
![]() |
![]() |
Tags |
analog, antialiasing, avisynth, subtitle |
Thread Tools | Search this Thread |
Display Modes | |
|
|