Bug 407405 - Pixel paint, Line Tool and Grid with 1px offset!
Summary: Pixel paint, Line Tool and Grid with 1px offset!
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Brush engines (show other bugs)
Version: 4.1.7
Platform: Mint (Ubuntu based) Linux
: NOR normal
Target Milestone: ---
Assignee: vanyossi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-10 19:21 UTC by Alexey
Modified: 2020-01-08 14:30 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
dancing pixels (19.23 KB, image/jpeg)
2019-05-10 19:21 UTC, Alexey
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey 2019-05-10 19:21:42 UTC
Created attachment 119965 [details]
dancing pixels

The Brush Tool and Grid cannot snap to the center of the pixel.

This causes some problems when trying to draw pixel art. The basic problem with diagonal lines. If we use the Line Tool, we get an uneven line with artifacts (see attachment). Since our line can't bind exactly to the center of the pixel (or something else) — we get a 'dancing pixels'.

1. Take an empty layer
2. Take Line Tool and 'pixel1' brush with sharpness
3. Try to draw a couple of good diagonal lines
Comment 1 vanyossi 2019-05-15 06:07:10 UTC
I don't see artifacts, but I see that with sharpness on, 45º angle line does weirds things.


I'll investigate
Comment 2 vanyossi 2019-12-04 07:52:01 UTC
Git commit b434751233e91d229617952bb73ca0744353bd10 by Ivan Yossi.
Committed on 04/12/2019 at 07:51.
Pushed by ivany into branch 'master'.

Fix 1px brush offset in line tool

This adjust the diferent position of KisPaintInformation
from a line to be inside a line between starting and
ending points. This is particularly important as brushes
that use 1px perfect pixels require the line to be perfect
in order to avoid looking jagged. In 1px size with
sharpen active we only use the start and end
KisPaintInformation points.

This patch also adjusts the outine on 1px brushes to
adjust to the grid to better preview where the paint is
going to be applyied

M  +2    -2    libs/image/brushengine/kis_paintop.cc
M  +10   -2    libs/image/kis_painter.cc
M  +4    -1    plugins/paintops/libpaintop/kis_brush_based_paintop_settings.cpp
M  +21   -2    plugins/paintops/libpaintop/kis_current_outline_fetcher.cpp
M  +2    -1    plugins/paintops/libpaintop/kis_current_outline_fetcher.h
M  +72   -0    plugins/tools/basictools/kis_tool_line_helper.cpp
M  +3    -0    plugins/tools/basictools/kis_tool_line_helper.h

https://invent.kde.org/kde/krita/commit/b434751233e91d229617952bb73ca0744353bd10
Comment 3 Alexey 2019-12-09 23:59:21 UTC
Cool news! Will tested it! ::)
Comment 4 Alexey 2019-12-11 01:42:59 UTC
All cool, that's works fine! ::)
Comment 5 Halla Rempt 2020-01-08 14:30:23 UTC
Git commit 9a972eea69526311cd95dd45335d2f1ba7d24fc3 by Boudewijn Rempt, on behalf of Ivan Yossi.
Committed on 08/01/2020 at 14:18.
Pushed by rempt into branch 'krita/4.2'.

Fix 1px brush offset in line tool

This adjust the diferent position of KisPaintInformation
from a line to be inside a line between starting and
ending points. This is particularly important as brushes
that use 1px perfect pixels require the line to be perfect
in order to avoid looking jagged. In 1px size with
sharpen active we only use the start and end
KisPaintInformation points.

This patch also adjusts the outine on 1px brushes to
adjust to the grid to better preview where the paint is
going to be applyied
(cherry picked from commit b434751233e91d229617952bb73ca0744353bd10)

M  +2    -2    libs/image/brushengine/kis_paintop.cc
M  +10   -2    libs/image/kis_painter.cc
M  +4    -1    plugins/paintops/libpaintop/kis_brush_based_paintop_settings.cpp
M  +21   -2    plugins/paintops/libpaintop/kis_current_outline_fetcher.cpp
M  +2    -1    plugins/paintops/libpaintop/kis_current_outline_fetcher.h
M  +72   -0    plugins/tools/basictools/kis_tool_line_helper.cpp
M  +3    -0    plugins/tools/basictools/kis_tool_line_helper.h

https://invent.kde.org/kde/krita/commit/9a972eea69526311cd95dd45335d2f1ba7d24fc3