mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-14 21:44:57 +00:00
Place, Open and relink read a CMYK or grayscale TIFF with an alpha channel through extra_samples_tiff_rgba, which cut every 16-bit sample to its high byte before converting it. A faint ink or a low alpha was lost: cyan 129 at full alpha showed as white, and an alpha of 129 became fully transparent. The samples are now normalized at the depth the file stores them, and only the resulting color and alpha are rounded to 8 bits (a 16-bit alpha to the nearest 8-bit value). Associated alpha is divided out at 16 bits. A pixel whose associated alpha is zero now has no color, instead of keeping its stored color. TIFF 6.0's Associated Alpha Handling section states this arithmetic and the zero-alpha rule for RGB data; applying them to CMYK and gray samples is VectorCraft's own rule.