diff options
author | Colin Basnett <cmbasnett> | 2022-02-09 12:27:35 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2022-02-09 12:28:00 +0300 |
commit | 6f01758b47c5cde0f8bf70d67e6240a092c04e27 (patch) | |
tree | caa5f9372b62563ed30afbcf29387e775d180ffb /source/blender/compositor/nodes/COM_FilterNode.cc | |
parent | 81da638c44b450d9cd1a208924eace40420666ff (diff) |
Added a "Sharpen Less" kernel for the Filter Compositor node
Added a new "Sharpen Less" kernel to the filter compositor node. The intent here is to provide a much less aggressive sharpening filter that can't simply be solved by toning down the factor on the existing sharpen filter.
The existing "Sharpen" filter uses a "box" kernel:
```
-1 -1 -1
-1 9 -1
-1 -1 -1
```
The new "Sharpen Less" filter uses a "diamond" kernel:
```
0 -1 0
-1 5 -1
0 -1 0
```
The difference between the two is clear to see in the following side-by-side:
{F12847431}
Below shows the difference between the filtering kernels as applied to a B&W render of Suzanne with the UV grid as a texture. The left side of the render using the existing "Sharpen" filter, and the right side showing the new "Sharpen Less" filter. Notice that the left side is more aggressive in accentuating localized contrasts across the image. This can lead to what appears to be aliasing or striations in the resulting image:
{F12847429}
https://developer.blender.org/T95275
https://blender.community/c/rightclickselect/57Kq/?sorting=hot
{F12847428}
Reviewed By: #compositing, jbakker
Differential Revision: https://developer.blender.org/D14019
Diffstat (limited to 'source/blender/compositor/nodes/COM_FilterNode.cc')
-rw-r--r-- | source/blender/compositor/nodes/COM_FilterNode.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/compositor/nodes/COM_FilterNode.cc b/source/blender/compositor/nodes/COM_FilterNode.cc index 2108e68cbec..4eca1492fe9 100644 --- a/source/blender/compositor/nodes/COM_FilterNode.cc +++ b/source/blender/compositor/nodes/COM_FilterNode.cc @@ -48,7 +48,7 @@ void FilterNode::convert_to_operations(NodeConverter &converter, 2 / 16.0f, 1 / 16.0f); break; - case CMP_FILT_SHARP: + case CMP_FILT_SHARP_BOX: operation = new ConvolutionFilterOperation(); operation->set3x3Filter(-1, -1, -1, -1, 9, -1, -1, -1, -1); break; @@ -80,6 +80,10 @@ void FilterNode::convert_to_operations(NodeConverter &converter, operation = new ConvolutionFilterOperation(); operation->set3x3Filter(1, 2, 1, 0, 1, 0, -1, -2, -1); break; + case CMP_FILT_SHARP_DIAMOND: + operation = new ConvolutionFilterOperation(); + operation->set3x3Filter(0, -1, 0, -1, 5, -1, 0, -1, 0); + break; default: operation = new ConvolutionFilterOperation(); operation->set3x3Filter(0, 0, 0, 0, 1, 0, 0, 0, 0); |