Re: [Gimp-developer] Size on disk vs size reported on status bar


On Tue, Oct 3, 2017 at 7:17 PM, Elle Stone
<ellestone ninedegreesbelow com> wrote:
I was curious about the disparity in reported size between the size on disk
in a file manager, and the size reported by "%m". I'm guessing "%m" is the
size in memory?

For example, I have a GIMP 2.9 XCF that is 4000 x 6000 pixels, 7 layers.
It's the early stages of a drawing, with very little information on the
various layers, just the main outlines, some guidelines and a merged layer
in shades of gray.

The size of the XCF file on disk is 11.5 MiB as measured by the Dolphin file
manager. When I open the XCF file in GIMP, the size shown in the status bar
is 3.8 GB.

I don't know how this info is computed in GIMP code (i.e. does it
check for actual memory size or does it do some basic maths as I am
about to do), but assuming your image is 8 bits per channel, and all 7
layers are the size of the image and have no alpha, that makes:
4000*6000*7*24 = 4 032 000 000 / 1024^3 ~ 3.8GB! :-)

Why such a huge difference in reported size?

Basically in memory, we don't compress. It doesn't matter if your
image were even full unicolor (which could compress perfectly and
could result in a file of a few bytes in any compressed format even if
the image was billions of pixels). As such, every bytes is fully
repeated in memory, even if it were the same.


gimp-developer-list mailing list
List address:    gimp-developer-list gnome org
List membership:
List archives:

ZeMarmot open animation film

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]