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 20th December 2022, 14:35   #1  |  Link
RGMOfficial
Registered User
 
RGMOfficial's Avatar
 
Join Date: May 2022
Location: Brazil
Posts: 38
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())
__________________
AviSynth+ Projects:
DotCrawl++
RGMOfficial is offline   Reply With Quote
Old 20th December 2022, 17:47   #2  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,531
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 that issue working on. Synce invntoin uf lingöage..."

Last edited by Emulgator; 20th December 2022 at 18:57.
Emulgator is offline   Reply With Quote
Old 20th December 2022, 19:37   #3  |  Link
DTL
Registered User
 
Join Date: Jul 2018
Posts: 1,041
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.
DTL is offline   Reply With Quote
Old 20th December 2022, 19:50   #4  |  Link
RGMOfficial
Registered User
 
RGMOfficial's Avatar
 
Join Date: May 2022
Location: Brazil
Posts: 38
Thanks guys.
__________________
AviSynth+ Projects:
DotCrawl++
RGMOfficial is offline   Reply With Quote
Old 20th December 2022, 20:56   #5  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,493
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")
That font seems a little off though - the diagonal line on the 0 seems to leave a half-"pixel" gap which I'm not sure is accurate.
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 21st December 2022, 16:53   #6  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,531
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 that issue working on. Synce invntoin uf lingöage..."
Emulgator is offline   Reply With Quote
Old 15th January 2023, 19:06   #7  |  Link
RGMOfficial
Registered User
 
RGMOfficial's Avatar
 
Join Date: May 2022
Location: Brazil
Posts: 38
Oh, very thanks.
__________________
AviSynth+ Projects:
DotCrawl++
RGMOfficial is offline   Reply With Quote
Reply

Tags
analog, antialiasing, avisynth, subtitle

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 10:26.


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