View Single Post
Old 4th May 2021, 17:07   #19093  |  Link
JKyle
App Digger
 
JKyle's Avatar
 
Join Date: Sep 2018
Posts: 411
Since @Atak_Snajpera seems to be back, I'd like to take this opportunity to ask him AGAIN if he doesn't object to redistributing this custom filter script (originally composed by him(?) for RipBot264) in StaxRip.

(Meanwhile, I've renamed the filter to CASm and modified some portion for maintenance in StaxRip.)

Code:
# CASm
#
# An improved sharpening script based on CAS and aWarpSharp2
#
# Original work by Atak_Snajpera for RipBot264
# Renamed and modded by JKyle 2021-04-22 for StaxRip
#
# ---Requirements---
#
# Core plugins:
#    CAS
#    aWarpSharp2
#
# ---Parameters---
# 
# float "strength" (default: 1.0)
# ----------------------------
# Same as CAS's parameter.
# Must be between 0.0 and 1.0.
#

function CASm(clip video, float "strength")
{
strength = default(strength, 1.0)

LevelLimit = (video.BitsPerComponent == 8) ? 255 : 1023
IntensityMask = ConvertToY(video).Levels(0, 2, LevelLimit, 0, LevelLimit, coring = false)
EdgeMask = aSobel(IntensityMask, chroma = 0, thresh = 255, SetAffinity = false).invert.Levels(0, 2, LevelLimit, 0, LevelLimit, coring=false).Blur(1)
SharpMask = Overlay(IntensityMask, EdgeMask, mode = "Multiply", opacity = 1.0)
SharpenedVideo = CAS(video, strength)
video = Overlay(video, SharpenedVideo, mask = SharpMask, opacity = 1.0)

return video
}
It will be saved as CASm.avsi and included in the default filter profiles in StaxRip.

Thanks in advance.
JKyle is offline   Reply With Quote