Port of AdobeHDS to C# from https://github.com/K-S-V/Scripts/blob/master/AdobeHDS.php