Created attachment 124644 [details] Thumbnail before and after delete free space SUMMARY STEPS TO REPRODUCE 1. Create New layer 2. Select area 3. Fill OBSERVED RESULT On layer thumbnail, layer occupies the entire canvas. EXPECTED RESULT if i delete free space around, then layer takes only visible space, as it should and release a part of used memory. SOFTWARE/OS VERSIONS Debian 10.0 XFCE krita-4.2.8-x86_64.appimage
This is interesting and best observed with only one new transparent paint layer in the image. If you fill a selection with a colour then the entire layer is filled with that colour but inside the selection the Alpha=255 and outside the selection the Alpha=0. This is observed using the Colour Selector Tool's display of RGB/A values. If you then Invert the selection and perform a Clear (Del) action, the displayed RGB/A values don't change and there is no change in the layer appearance but RAM usage drops and you see this in the layer thumbnail as was described. If you then Undo Clear, the entire selected area (outside the original filled selection) becomes filled with the colour so that the entire layer is filled with visible colour. This is obviously not the correct result from a user's point of view. What does Clear actually do? What does Undoing Clear actually do? If an area is tranpsarent, what RGB values should it have? I'll set this to Confirmed because the behaviour results in some inconsistency.
@Ahab the issue with undoing is I believe another bug, even if is related or the reproduction is similar. This bug is related to bug 412560 and maybe bug 414903.
@Tymond It does look like it's related to the other bugs you mentioned, i.e. the empty/non-empty tiles situation. Maybe you should mark it as a Duplicate for these? As for the points I raised in my comment, I've looked at this again and I'll have to withdraw my observations as follows: 1. The Undo Clear now does not fill the area outside the original region with colour. It did, I swear it did, but it now no longer happens. 2. My observations about the RGB/A values outside the selected region are, I believe, not valid because the colour picker seems to not update the RGB values if A=0, but it does update the A value. Maybe this is to be expected? I've made further tests and observations where, according to the layer thumbnail, there is off-canvas content introduced. A Trim to Image Size reduces the memory required and also sets the layer thumbnail back to the original appearance. However, this behaviour depends on the size of the image and using different sizes of image gives different results. Also, painting outside the selected region increases the memory required and then Clearing outside the original region (which is transparent) reduces the memory. Again, this is variable depending on the size of the image. It is confusing. At this stage, I'm not going to do detailed testing and reports but I'd be happy to do that if you feel it would be useful.
Has this been resolved?
Doing this with the Aug 21 4.4.0 alpha (git ba852b2) appimage and comparing the same test with the 4.2.8 appimage shows that there is now no additional content as indicated by the thumbnail and the RAM indicator. Setting to RESOLVED FIXED
@Ahab are you using the "Use selection as boundary" mode? It does fix the issue. However I believe that unchecking it will still result in this bug.
@Tymond: You are correct. With 'Use selection as boundary:' unchecked, there is content outside the selection as indicated on the thumbnail and notable increased RAM usage with the Aug 21 4.4.0 alpha appimage. Setting to REPORTED
Git commit 96871c73cef66935edd00e267c497702beb29697 by Deif Lou. Committed on 23/02/2022 at 15:01. Pushed by deiflou into branch 'master'. Make fill tool produce regions with minimal size when a selection is used M +5 -1 libs/image/kis_fill_painter.cc https://invent.kde.org/graphics/krita/commit/96871c73cef66935edd00e267c497702beb29697