I work with 360-degree content and related algorithms a lot, I have an online service processing 360 images. I would be glad if you could find a solution, but I don't think what you want can be fully automates. EXIF files do not contain information about tilt angles, so you'll have to rely on some kind of auto-detection mechanism, like gothru does. They try to detect horizon and then adjust the tilt angle, but even for your sample images their algorithm doesn't work so good. When applied to the second image it does not produce accurate result (I tried). I quickly tried adjusting tilt angle for your images based on similar algorithm detecting horizon and found that I also need to adjust pitch angle because source images are not just tilted horizontally, but also "look up" a bit. Detecting it automatically would be hard and still you will not get 100% accurate solution. I still can build a batch processor for you based only on horizon angle detection if you'd want. Or build a UI where you could tilt images manually. Let me know if you'd like to proceed and we can talk through details. Thanks!