A minor bug that I just found. One of the brush previews is displayed in black and white (opaque) while most other ones are displayed transparent (black on dark grey). But all of them are opaque PNG files without alpha channels. Here are three files. A screenshot of the issue and two brush tips of which the rounder one is displayed transparently and the longer one is displayed opaque. http://www.argfx.at/upload/Krita_BrushSettings_02.zip SOFTWARE/OS VERSIONS Windows: 10 64-Bit macOS: Linux/KDE Plasma: (available in About System) KDE Plasma Version: KDE Frameworks Version: Qt Version: ADDITIONAL INFORMATION
Yes, there is something weird with parsing PNG brushes. Evevn fully transparent PNGs are loaded with white background in the preview. Though it doesn't happen with GBR brushes. It looks as if the background generation code is resource type dependent.
This bug is a regression after bug 445691, commits https://invent.kde.org/graphics/krita/-/commit/31a44cf99165efb16e905ed209dbdcdea57f8509 https://invent.kde.org/graphics/krita/-/commit/357aff91fd5c03aa58c7691a7fb8493ceff5fad1
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1474
Git commit d1dd249f9e7e39d01e6cd72f9d475a14e28a6333 by Dmitry Kazakov. Committed on 15/06/2022 at 09:27. Pushed by dkazakov into branch 'master'. Fix background painting in the predefined brush selector The patch does multiple fixes: 1) Removes a hacky conversion of a PNG brush into a mask brush if the brush is all gray. All-gray brushes can easily be used in lightness mask mode. 2) Implements separator lines in the predefined brush selector and fixes hidpi support in it. 3) Implements checkers background painting for the brushes that support transparency, and therefore, lightness mode. 4) All other brushes are now painted on white background 5) To let the selector know if the brush has transparency, this property is written into the brush'es metadat. To do that, a special class KisBrushTypeMetaDataFixup is implemented. It updates the database, if finds any inconsistent reconrds at the database. M +1 -0 libs/brush/CMakeLists.txt A +58 -0 libs/brush/KisBrushTypeMetaDataFixup.cpp [License: GPL(v2.0+)] A +19 -0 libs/brush/KisBrushTypeMetaDataFixup.h [License: GPL(v2.0+)] M +3 -0 libs/brush/kis_brush.cpp M +2 -0 libs/brush/kis_brush.h M +0 -9 libs/brush/kis_png_brush.cpp M +2 -7 libs/brush/kis_svg_brush.cpp M +2 -0 libs/brush/tests/CMakeLists.txt A +- -- libs/brush/tests/data/bw-alpha-solid.png A +- -- libs/brush/tests/data/bw-alpha-transp.png A +- -- libs/brush/tests/data/bw-no-alpha-solid.png A +- -- libs/brush/tests/data/color-alpha-solid.png A +- -- libs/brush/tests/data/color-alpha-transp.png A +49 -0 libs/brush/tests/kis_png_brush_test.cpp [License: GPL(v2.0+)] A +22 -0 libs/brush/tests/kis_png_brush_test.h [License: GPL(v2.0+)] M +24 -1 libs/resources/KisResourceLoaderRegistry.cpp M +18 -0 libs/resources/KisResourceLoaderRegistry.h M +8 -1 libs/resources/KisResourceLocator.cpp M +1 -0 libs/resources/KisResourceLocator.h M +3 -0 libs/ui/KisApplication.cpp M +48 -8 plugins/paintops/libpaintop/kis_predefined_brush_chooser.cpp https://invent.kde.org/graphics/krita/commit/d1dd249f9e7e39d01e6cd72f9d475a14e28a6333
Git commit 159bbd6e0392298361b7427e315e7b14b09e996c by Dmitry Kazakov. Committed on 15/06/2022 at 09:28. Pushed by dkazakov into branch 'krita/5.1'. Fix background painting in the predefined brush selector The patch does multiple fixes: 1) Removes a hacky conversion of a PNG brush into a mask brush if the brush is all gray. All-gray brushes can easily be used in lightness mask mode. 2) Implements separator lines in the predefined brush selector and fixes hidpi support in it. 3) Implements checkers background painting for the brushes that support transparency, and therefore, lightness mode. 4) All other brushes are now painted on white background 5) To let the selector know if the brush has transparency, this property is written into the brush'es metadat. To do that, a special class KisBrushTypeMetaDataFixup is implemented. It updates the database, if finds any inconsistent reconrds at the database. M +1 -0 libs/brush/CMakeLists.txt A +58 -0 libs/brush/KisBrushTypeMetaDataFixup.cpp [License: GPL(v2.0+)] A +19 -0 libs/brush/KisBrushTypeMetaDataFixup.h [License: GPL(v2.0+)] M +3 -0 libs/brush/kis_brush.cpp M +2 -0 libs/brush/kis_brush.h M +0 -9 libs/brush/kis_png_brush.cpp M +2 -7 libs/brush/kis_svg_brush.cpp M +2 -0 libs/brush/tests/CMakeLists.txt A +- -- libs/brush/tests/data/bw-alpha-solid.png A +- -- libs/brush/tests/data/bw-alpha-transp.png A +- -- libs/brush/tests/data/bw-no-alpha-solid.png A +- -- libs/brush/tests/data/color-alpha-solid.png A +- -- libs/brush/tests/data/color-alpha-transp.png A +49 -0 libs/brush/tests/kis_png_brush_test.cpp [License: GPL(v2.0+)] A +22 -0 libs/brush/tests/kis_png_brush_test.h [License: GPL(v2.0+)] M +24 -1 libs/resources/KisResourceLoaderRegistry.cpp M +18 -0 libs/resources/KisResourceLoaderRegistry.h M +8 -1 libs/resources/KisResourceLocator.cpp M +1 -0 libs/resources/KisResourceLocator.h M +3 -0 libs/ui/KisApplication.cpp M +48 -8 plugins/paintops/libpaintop/kis_predefined_brush_chooser.cpp https://invent.kde.org/graphics/krita/commit/159bbd6e0392298361b7427e315e7b14b09e996c