Created attachment 123083 [details] Example of the black "textures" created by this bug. Certain textures default to black whenever a document with the "pattern overlay" layer style is reopened. STEPS TO REPRODUCE 1. Apply the "pattern overlay" layer style to any layer, using a texture with relatively few values between black and white (happens with near certainty with textures consisting of only #000000 black and #FFFFFF white, but also occurs to textures such "Hexacol BW By Tarkan") 2. Save the .kra document and close. 3. Reopen the document. OBSERVED RESULT Document replaces the overlay texture with a featureless black one. The black "texture" is added to the texture menu with the same exact path as the intended texture, and both of them exist in the menu at the same time. EXPECTED RESULT Document retains the correct overlay texture. No superfluous "textures" are added to the menu. SOFTWARE/OS VERSIONS Windows 10 Professional ADDITIONAL INFORMATION This has been a problem since the 4.1.x versions, probably earlier. Since I work extensively with aliased, pixel-perfect textures for my trade, this is of high importance to me.
Hi, Thanks for your report. I can reproduce the issue.
There are additional related complications: When this happens, the black texture appears in the Patterns docker and also in the patterns menu for the Brush Editor patterns parameter selector menu. It happens with default installation textures as well as personal resource textures. I think it may be related to transparency in the pattern because it doesn't happen with solid colour patterns. If you Close and Quit and restart, if you'd selected a texture from the standard default installation, the full path of the texture refers to the previous /tmp/.mount-- location. This is probably because the pattern location is stored in the .kra file though it can't be correct for future sessions. There is a similar problem (but no black patterns) if you use a default installation pattern fill on a Fill layer and then Save, Close and restart then reopen the image: the pattern is not shown.
I think this has always been broken. 3.0 gives as output krita.general: WARNING: Saved pattern doesn't have a UUID, generating... krita.general: patternFileName = "/home/boud/.local/share/krita/patterns/hexacolBW__2.pat" pattern->name() = "Hexacol BW By Tarkan"
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1089
The problem happens because hexacolBW__2.pat pattern has transparency support, but ASL doesn't seem to support that. Or at least our implementation of it doesn't writing Alpha into ASL.
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1091
Git commit 87df1d81b13d1a1df7e3e1529041c0a055cb94f6 by Dmitry Kazakov. Committed on 14/10/2021 at 12:36. Pushed by dkazakov into branch 'master'. Fix double-embedding of the resources into the document Original desing of the do document-storage was supposed to store the embedded resources in memory, while the document is loaded and unload them from the memory, as soon as the document is unloaded. But after July's embed-all refactoring its meaning has changed. Instead it is used to store the resources that should be embedded into the document separately. Therefore, now this storage of the resources must not include the resources that are embedded via other means, e.g. asl layer styles or asl/psd patterns. Right now, the only place where this storage is really used for embedding stuff is KisPaletteEditor. If we want to recover the idea of "a memory-only storage that unloads the resources on document unloading", we need to make a separate storage for such temorary data. The commit doesn't fix the bug linked, but it removes warnings about trying to save non-serializable resources into a persistent storage. M +0 -3 libs/image/KisResourceCollectorVisitor.h M +3 -0 libs/ui/KisDocument.cpp M +1 -1 plugins/impex/libkra/kis_kra_loader.cpp M +1 -1 plugins/impex/psd/psd_loader.cpp https://invent.kde.org/graphics/krita/commit/87df1d81b13d1a1df7e3e1529041c0a055cb94f6
Git commit eea3ff549188b6ba86fbf44303e4167add84e973 by Dmitry Kazakov. Committed on 14/10/2021 at 12:38. Pushed by dkazakov into branch 'krita/5.0'. Fix double-embedding of the resources into the document Original desing of the do document-storage was supposed to store the embedded resources in memory, while the document is loaded and unload them from the memory, as soon as the document is unloaded. But after July's embed-all refactoring its meaning has changed. Instead it is used to store the resources that should be embedded into the document separately. Therefore, now this storage of the resources must not include the resources that are embedded via other means, e.g. asl layer styles or asl/psd patterns. Right now, the only place where this storage is really used for embedding stuff is KisPaletteEditor. If we want to recover the idea of "a memory-only storage that unloads the resources on document unloading", we need to make a separate storage for such temorary data. The commit doesn't fix the bug linked, but it removes warnings about trying to save non-serializable resources into a persistent storage. M +0 -3 libs/image/KisResourceCollectorVisitor.h M +3 -0 libs/ui/KisDocument.cpp M +1 -1 plugins/impex/libkra/kis_kra_loader.cpp M +1 -1 plugins/impex/psd/psd_loader.cpp https://invent.kde.org/graphics/krita/commit/eea3ff549188b6ba86fbf44303e4167add84e973
Git commit 04e2561eefaf4822d3a5b9b02dd9210900137523 by Halla Rempt, on behalf of Dmitry Kazakov. Committed on 18/10/2021 at 10:04. Pushed by rempt into branch 'master'. Fix layer styles to handle transparent patterns consistently In general, ASL styles don't support patterns with transparency, so we should premultiply and remove transparency from a pattern before applying it to the layer style. The same applies to the ASL pattern saving process. M +1 -1 libs/image/kis_asl_layer_style_serializer.cpp M +1 -1 libs/image/kis_psd_layer_style.cpp M +18 -0 libs/image/layerstyles/kis_layer_style_filter_environment.cpp M +3 -0 libs/image/layerstyles/kis_layer_style_filter_environment.h M +7 -1 libs/image/layerstyles/kis_ls_utils.cpp M +1 -1 libs/image/tests/kis_asl_layer_style_serializer_test.cpp M +3 -3 libs/image/tests/kis_layer_style_projection_plane_test.cpp M +25 -1 libs/pigment/resources/KoPattern.cpp M +11 -1 libs/pigment/resources/KoPattern.h M +2 -0 libs/psd/psd_pixel_utils.h M +6 -0 libs/psdutils/asl/kis_asl_patterns_writer.cpp M +5 -0 libs/resources/KisLocalStrokeResources.cpp M +1 -0 libs/resources/KisLocalStrokeResources.h https://invent.kde.org/graphics/krita/commit/04e2561eefaf4822d3a5b9b02dd9210900137523
Git commit 2b95e676aa47ac325c356780ac3b8a849f2dd70d by L. E. Segovia. Committed on 21/10/2021 at 13:07. Pushed by lsegovia into branch 'master'. Fix two typos in PSD pattern alpha premultiply M +0 -2 libs/psd/psd_pixel_utils.h M +2 -2 libs/psdutils/asl/kis_asl_patterns_writer.cpp https://invent.kde.org/graphics/krita/commit/2b95e676aa47ac325c356780ac3b8a849f2dd70d