How to set 'Grayscale from' to 'Alpha' in Image Editor via script

I want to set a PNG image with an alpha channel to Cutout Opacity and use that alpha channel. I can do that with the Image Editor. However, can I set it via a script?
You currently have no notifications.
I want to set a PNG image with an alpha channel to Cutout Opacity and use that alpha channel. I can do that with the Image Editor. However, can I set it via a script?
Licensing Agreement | Terms of Service | Privacy Policy | EULA
© 2025 Daz Productions Inc. All Rights Reserved.
Comments
I don't know about doing that with a script, but you can save a material preset and merge it each time you want to set it.
Thanks for reply. I think it's easier, but I really want to do that via scripting.
I made a script "Load Image as Plane". I want to automatically cut out the alpha channel when loading a PNG image.