ImageMagick is a very powerful command-line image manipulation software: scaling, orientation, borders, text... Use these various tools in programs written in C, C++, Ruby, Python, Perl, etc…