10-24-2024, 08:12 AM
(10-24-2024, 01:14 AM)jrickards Wrote: Hi:
GIMP 2.10.34 on Linux Mint
I opened 8 ~16Mpx photo images as layers. I first tried 8 PNG (~80MB each) but the XCF file was huge (919MB) so I exported the photos from darktable as JXL (~4MB each) and the XCF was still huge (925MB), both XCF saved with the higher compression option.
Photoshop has a "Place Linked" option which I presume doesn't copy the placed files into the working file, presumably creating a much smaller saved copy of the working file. (I have PS at work but I haven't explored this option so I'm guessing).
Is there any way to create a layered XCF file that isn't so huge?
The format of the input file is irrelevant, what count is the size in pixels, because compressed format like JXL are expanded.
What makes a great difference if the image precision. The image is either in 8-bit/channel (one byte) ("native" precision of JPEG/PNG) or 32-bit/channel (4 bytes) (high precision). There are also 16-bits/channel precision modes but they are unimportant. Depending on input format, and settings (Preferences ➤ Image import and export ➤ Import policy ➤ Promote imported images...) the image is loaded in 8bpc or 32bpc. Of course if you come from a raw, using 8-bit precision is shedding useful bits of information.
If you load the image, the RAM you use is width × height × 4 (channels) * (layers+2) bytes (the 2 additional layers are actually buffers for the composite image). So with my 20Mpix camera, 8 layers are 764MB in low precision, and 3.2GB is high precision. And of course when you work on it you add undo snapshots...
When you save the image as XCF, there is a compression option at the bottom of the file dialog. Using my 8 random pictures of vintage cars, I get:
RAM Size Plain XCF Compressed XCF
-------- --------- --------------
8 bpc: 764MB 422MB 210MB
32 bpc: 3.2GB 1.3GB 305MB
so the compression is quite efficient (but is also quite slow) .