There are many tools in the ENVI Toolbox that have an AP:
https://www.harrisgeospatial.com/do...nes-2.html However there is no exposed API for ENVI's photographic stretch. Some tools do not have an API and this is one of the older tools that does not unfortunately.