05.02.2025, 21:17
It seems to me that with the help of levels and gamma, you can not only cut off the effect as binarization does, but redistribute the effect.
For example, we have a line that fades out smoothly, if you use binarization, then the filter effect will simply be cut off in the middle of the line.
When using levels and gamma, you could set the necessary restrictions, but make them more planar.
Examples:
Normal Sobel Mask
![[Image: _3b6133523bccd260e6911d4b11a4e3a1.jpeg]](https://i124.fastpic.org/thumb/2025/0205/a1/_3b6133523bccd260e6911d4b11a4e3a1.jpeg)
![[Image: _76ced3c55b05057b4bc6ba0efdd74ab4.jpeg]](https://i124.fastpic.org/thumb/2025/0205/b4/_76ced3c55b05057b4bc6ba0efdd74ab4.jpeg)
![[Image: _329954ff3ce86e8d44142cacdaa55137.jpeg]](https://i124.fastpic.org/thumb/2025/0205/37/_329954ff3ce86e8d44142cacdaa55137.jpeg)
![[Image: _8e13ebecdb1be9624a1c56006d590406.jpeg]](https://i124.fastpic.org/thumb/2025/0205/06/_8e13ebecdb1be9624a1c56006d590406.jpeg)
For example, we have a line that fades out smoothly, if you use binarization, then the filter effect will simply be cut off in the middle of the line.
When using levels and gamma, you could set the necessary restrictions, but make them more planar.
Examples:
Normal Sobel Mask
![[Image: _3b6133523bccd260e6911d4b11a4e3a1.jpeg]](https://i124.fastpic.org/thumb/2025/0205/a1/_3b6133523bccd260e6911d4b11a4e3a1.jpeg)
clipMask = havsfunc.SmoothLevels(input=clipMask, input_low=0, input_high=300, output_low=0, output_high=1020, gamma=1.0, Ecurve=0)
![[Image: _76ced3c55b05057b4bc6ba0efdd74ab4.jpeg]](https://i124.fastpic.org/thumb/2025/0205/b4/_76ced3c55b05057b4bc6ba0efdd74ab4.jpeg)
clipMask = havsfunc.SmoothLevels(input=clipMask, input_low=0, input_high=300, output_low=0, output_high=1020, gamma=0.3, Ecurve=0)
![[Image: _329954ff3ce86e8d44142cacdaa55137.jpeg]](https://i124.fastpic.org/thumb/2025/0205/37/_329954ff3ce86e8d44142cacdaa55137.jpeg)
clipMask = havsfunc.SmoothLevels(input=clipMask, input_low=0, input_high=300, output_low=0, output_high=1020, gamma=1.5, Ecurve=0)
![[Image: _8e13ebecdb1be9624a1c56006d590406.jpeg]](https://i124.fastpic.org/thumb/2025/0205/06/_8e13ebecdb1be9624a1c56006d590406.jpeg)
clipMask = havsfunc.SmoothLevels(input=clipMask, input_low=0, input_high=1020, output_low=0, output_high=1020, gamma=2.0, Ecurve=0)
![[Image: _a1fabf61e59f24824fcaf10c70cac25e.jpeg]](https://i124.fastpic.org/thumb/2025/0205/5e/_a1fabf61e59f24824fcaf10c70cac25e.jpeg)