Check if image has alpha channel
I just discovered this command (in the Properties and Relations sections of the AlphaChannel
command)
ImageMeasurements[img, "Transparency"]
It returns True
if there is an alpha channel and False
otherwise.
How about this:
RemoveAlphaChannel[img] == img
If img has no alpha channel, this returns True, but returns False if img has an alpha channel.
SetAlphaChannel[img] == img
seems to work too, but with the reverse logic.
As of V12, Information
can return this:
Information[ExampleData[{"TestImage", "Lena"}], "Transparency"]
False