Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Less data = heavier file ?
#1
I just noticed that putting layers in a group layer makes a noticeably heavier xcf (in my test an xcf went from 1.2 to 1.5 GB).

But it gets more interesting : if your layers have masks and you think you can save some space by deleting them and putting a single mask for the group, it will still be heavier than when you had individual masks (even if the masks were different). In other words you'll have less data to work with but the file will be heavier.
I don't understand why. Does anyone know?
Reply
#2
This is the image size shown at the bottom of the Gimp Window ? - The size in memory

My guess, and it is only a guess.

This also shows any memory used by "undo" Even when undo levels are set to zero, if there is memory allocated it will be used. Look in Edit -> Preferences -> System Resources for those settings.

Adding and moving into a layer group does add the equivalent of a couple more regular layers at least it does here. Adding a mask to the layer group however is neutral.
Reply
#3
(07-31-2020, 09:56 AM)rich2005 Wrote: This is the image size shown at the bottom of the Gimp Window ? - The size in memory

No it's the file size as shown by my file browser after the xcf has been saved and closed.

It can't be caused by the undo steps because if I do it in inverse order (start from group version and make individual masks version), the group version is still heavier.
Reply
#4
I just tried on the latest 2.99 dev flatpak and nothing seems to have changed in that regard.

After some more testing I'm pretty sure that a mask applied to a group will cause the xcf to contain a copy of the mask data for each layer (which can get  extremely redundant if you have many layers under a group).

I attached to this post 2 files to show why I came to this conclusion:
  • the first one contains 4 layers with 4 masks, all made of pure noise. All noise patterns have a different seed, making this file contain 8 uncompressible "drawables" (as gimp calls it).
  • the second one contains the same 4 layers but this time only one mask applied to a group that contains the 4 layers, meaning this time there are only 5 uncompressible drawables.
Yet, both files have a size of 1.84MB. And to be clear you can make these noise patterns large enough to make a 32MB xcf, the size difference between the first and second version will be in the kilobytes, meaning it's only a matter of which noise pattern is slightly more compressible than which other.

This would also explain why in my first experiments I sometimes ended up with heavier "group" versions.
In a group version I could be using one "not so compressible" mask for the group whereas in the "non-grouped" version, even though I was using non-identical masks (meaning they collectively contain more data than a single one), they were individually more compressible. And since the group version duplicates the data, it makes a heavier xcf regardless.

Whether my conclusion is correct or not...
Is this a known issue and is there a plan to address this memory inefficiency?
This has been a deal-breaker for me. In fact I've avoided using groups in my work since my first post on this thread (more than a year).


Attached Files
.xcf   noise.xcf (Size: 1.84 MB / Downloads: 144)
.xcf   noise-group.xcf (Size: 1.84 MB / Downloads: 133)
Reply
#5
Quote:Whether my conclusion is correct or not...
Is this a known issue and is there a plan to address this memory inefficiency?

Why not ask the Gimp developers directly: https://gitlab.gnome.org/GNOME/gimp/-/issues
or if IRC is your thing, https://www.gimp.org/irc.html
Reply
#6
Sure, here it is : https://gitlab.gnome.org/GNOME/gimp/-/issues/7494
Reply


Forum Jump: