It is currently Tue Aug 18, 2026 2:34 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 23 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: XCF File Size
PostPosted: Fri Nov 29, 2013 12:44 pm  (#21) 
Offline
GimpChat Member

Joined: Apr 29, 2013
Posts: 203
saulgoode wrote:
When you clear a layer, its alpha channel is filled with zero (black) so that it is visibly transparent :geeking however, the values in the red, green, and blue channels are left unchanged. Why waste time changing something that isn't going to be seen anyway?

You can verify that this is what is happening by performing a "Colors->Components->Decompose" to RGBA after clearing your layer.

I don't really understand, but right, RGB channel is unchanged (in greyscale) and alpha channel is black. :roll:

saulgoode wrote:
Why waste time changing something that isn't going to be seen anyway?

Oh, because I notice even after I clear a layer, it seems there is huge file size difference, like I don't clear the layer before... :oops:
(so maybe delete layer and make a new layer is better than clear a layer? Hmm... ) :geeking

_________________
~


Top
 Post subject: Re: XCF File Size
PostPosted: Fri Nov 29, 2013 2:11 pm  (#22) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
Zeo wrote:
I don't really understand, but right, RGB channel is unchanged (in greyscale) and alpha channel is black. :roll:

Another, perhaps more intuitive, way to see this is to add layermask to your layer, and initialize it using the "Transfer layer's alpha channel" option. You can then hide the layermask and see the original RGB image.
Zeo wrote:
(so maybe delete layer and make a new layer is better than clear a layer? Hmm... ) :geeking

You can force the RGB channels of transparent pixels in a layer to black by adding a new transparent layer and merging it down.

It is debatable whether GIMP should be doing this automatically when you save to XCF. While your point about reducing file size is valid, there are some users out there who like to use GIMP to edit images where the alpha channel represents something other than transparency (for example, some game engines use the alpha channel as a depth map). To these users, fully saving the RGB channels is important -- indeed, they complain about the way GIMP removes the RGB info about transparent pixels when operations such as merging of layers is performed.

The GIMP developers' response to this conflict of interests is to basically do whatever they think is best, without committing to one way or another; the behavior of the RGB channels for fully transparent pixels in a layer is undefined. GIMP doesn't agree to support retaining the values, nor does it go out of its way to remove them.

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: XCF File Size
PostPosted: Fri Nov 29, 2013 2:19 pm  (#23) 
Offline
GimpChat Member
User avatar

Joined: Sep 22, 2012
Posts: 2089
Location: US
Zeo wrote:
Oh, because I notice even after I clear a layer, it seems there is huge file size difference, like I don't clear the layer before... :oops:
(so maybe delete layer and make a new layer is better than clear a layer? Hmm... ) :geeking


While you're still working on document in GIMP, clearing or deleting layers only adds up to memory size
because gimp keeps information on changes for undo operations (up to the N of steps set in Preferences).
But when you close the document (save it), gimp dumps undo history (doesn't write/store it) and the file size is much smaller on disk
than it was in the swap folder during gimp session.


Top
Post new topic Reply to topic  [ 23 posts ]  Go to page Previous  1, 2

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group