Created attachment 113478 [details] Fuzzy border selection result The Selections Tools in the toolbox now has a on-canvas context menu. In it, there is "Transform" item that expands and allows user to make Border Selection based on the current selection outline. However, the resulting Border Selection is always fuzzy. Reproduce: 1) Rectangular Selection Tool, select an rectangular area. 2) Right-click >> Transform >> Border selection 3) Border width: 3 >> OK 4) Fill the result selection area with red 5) It the filled color has fuzzy edges. I think when we first generate the border selection, it should be always as sharp as possible for it to be really useful. Or better, let user determine how fuzzy the border selection's edges will be. After all, you can always make a sharp selection fuzzy, but you can never make a fuzzy selection sharp.
BTW I tried in Tool options dockers turning on and off Anti-aliasing and switching between pixel selection and vector selection, but none of those options work.
Can confirm, border selection always has semi-transparent pixels on the edges.
To fix this bug, we should refactor our selection filters code not to use old explicit code and use KisGaussianKernel::applyDilate/applyErodeU8() instead.
Hi, Tyson! Should border-selection filter be antialiased or not? Or there should be an option?
Hi Dmitry, I think it should be optional, because you can't use anti-aliasing in pixel art.
Git commit 40ee22112db68ed3c2c0690d88da93cd7994b19d by Dmitry Kazakov. Committed on 15/06/2020 at 19:06. Pushed by dkazakov into branch 'krita/4.3'. Fix border selection to generate non-fuzzy edges Border should use erode/dilate kernel instread of a triangular one. The patch also adds a new option: border seleciton can now do optional antialiasing of the edge. M +54 -18 libs/image/kis_selection_filters.cpp M +2 -1 libs/image/kis_selection_filters.h M +1 -1 libs/libkis/Selection.cpp M +1 -1 libs/libqml/KisSelectionExtras.cpp M +24 -0 plugins/extensions/modify_selection/dlg_border_selection.cc M +4 -0 plugins/extensions/modify_selection/dlg_border_selection.h M +2 -1 plugins/extensions/modify_selection/modify_selection_operations.cpp M +63 -56 plugins/extensions/modify_selection/wdg_border_selection.ui https://invent.kde.org/graphics/krita/commit/40ee22112db68ed3c2c0690d88da93cd7994b19d
Git commit 18511f5e5b80e82fcc1d6429b6a94487c0e3cc1a by Dmitry Kazakov. Committed on 15/06/2020 at 19:06. Pushed by dkazakov into branch 'master'. Fix border selection to generate non-fuzzy edges Border should use erode/dilate kernel instread of a triangular one. The patch also adds a new option: border seleciton can now do optional antialiasing of the edge. M +54 -18 libs/image/kis_selection_filters.cpp M +2 -1 libs/image/kis_selection_filters.h M +1 -1 libs/libkis/Selection.cpp M +1 -1 libs/libqml/KisSelectionExtras.cpp M +24 -0 plugins/extensions/modify_selection/dlg_border_selection.cc M +4 -0 plugins/extensions/modify_selection/dlg_border_selection.h M +2 -1 plugins/extensions/modify_selection/modify_selection_operations.cpp M +63 -56 plugins/extensions/modify_selection/wdg_border_selection.ui https://invent.kde.org/graphics/krita/commit/18511f5e5b80e82fcc1d6429b6a94487c0e3cc1a
Thank you Dmitry! :D