Skip to content
  • Michael Natterer's avatar
    Bug 791519 - Unexpected selection from channel · bb4ac7c8
    Michael Natterer authored
    Storing selections and layer masks as linear grayscale, but channels
    as whatever-the-layers-are caused severe problems in images with
    gamma-corrected layers: when combining channels with the selection,
    they would go thorugh a gamma conversion before being combined, giving
    unexpected results.
    
    This commit changes all channels to always be linear, except in 8-bit
    images, where they continue to be "Y' u8", for compatibility with old
    XCF files, and because linear 8-bit can't really be used in
    compositing (channels can be visible too).
    
    To fix channel -> selection combinations also for these images, add a
    small hack to gimp_gegl_mask_combine_buffer() which makes sure the
    to-be-combined channel's pixels are always read as-is, without any
    gamma conversion. After changing channels to linear, this makes no
    difference except in the 8-bit images where we need this hack.
    bb4ac7c8