The latest version of GraphicsMagick is stricter when it comes to reading TIFF images with transparency. It is now a requirement that TIFFTAG_EXTRASAMPLES is defined in the image file for the alpha channel:
http://hg.code.sf.net/p/graphicsmagick/code/rev/5c6fd2a5e177
Afaict, that is conform to the standard:
https://www.awaresystems.be/imaging/tiff/tifftags/extrasamples.html
However, the TIFF files with transparency that are created by GraphicsMagick itself don't write that tag for the matte channel (with default parameters).
The attached patch sets the default for that parameter to a reasonable value for most use cases. Users can still overwrite that default. Essentially, it allows that GraphicsMagick can do a complete round-trip of writing and reading such a file like in previous versions (without needing to set a specific option).
See also this downstream PR:
https://github.com/msys2/MINGW-packages/pull/18183
PS: Imho, it is a pity that GraphicsMagick now refuses to read the alpha channel of files that it wrote itself (with default settings).
Ooops! Sorry about that! I see that there is an TIFFTAG_EXTRASAMPLES, but it uses value 0 (EXTRASAMPLE_UNSPECIFIED) but it seems that it needs to be 2 (EXTRASAMPLE_UNASSALPHA).
Your patch is submitted via Mercurial changeset 17155:a412298d004b. It is very unfortunate that I was not aware that GraphicsMagick has been improperly marking files and now it discards transparency for files written by older versions. I will will study restoring a conservative approach to reading the improperly marked files. The problem is that bogus files are able to provide many permutations of claimed channels/samples and it is very difficult to protect against misbehavior.
Mercurial changeset 17162:15a0fc19fa0c restores the ability to read the alpha channel from TIFF files with an 'unspecified' channel type. It only does this for particular photometrics and numbers of channels.
Things had been made more strict since fuzzers were creating a great many permutations of photometrics and extra channels and some of them were causing issues inside of libtiff.