'how to add spot color channel to a tiff image use some code?

I need to add an additional channel (with a custom name, not alpha) to a tiff image. I'm surprised how difficult this is, because the tiff-secification says it is possible to add custom channels and PhotoShop is able to do it. Now I'm looking for a way to automate it....

Does anyone know whether it is now possible with any code or any framework?

like this in photoshop: https://i.stack.imgur.com/xtOzb.png



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source