 <p>It has not been mentioned yet, so I will point out that OpenCV has functions for scaling and rotating images, as well as an enormous number of other utilities. It may contain many features that are not relevant to the question, but it is very easy to setup and use for a library of its kind.</p> <p>You can try to implement transformations like this manually, but the simple approach to scaling and rotating will generally result in a significant loss of detail. </p> <p>Using OpenCV, scaling can be done like so:</p> <pre><code>float scaleFactor = 0.68f; cv::Mat original = cv::imread(path); cv::Mat scaled; cv::resize(original, scaled, cv::Size(0, 0), scaleFactor, scaleFactor, cv::INTER_LANCZOS4); cv::imwrite("new_image.jpg", scaled); </code></pre> <p>This scales the image down by a factor of 0.68 using Lanczos interpolation. </p> <p>I am not as familiar with rotations, but here's part of an example from one of the tutorials on the OpenCV website that I have edited down to the relevant parts. (The original had skew and translation in it also...)</p> <pre><code>/// Compute a rotation matrix with respect to the center of the image Point center = Point(original.size().width / 2, original.size().height / 2); double angle = -50.0; double scale = 0.6; /// Get the rotation matrix with the specifications above Mat rot_mat( 2, 3, CV_32FC1 ); rot_mat = getRotationMatrix2D(center, angle, scale); /// Rotate the image Mat rotated_image; warpAffine(src, rotated_image, rot_mat, src.size()); </code></pre> <p><a href="http://opencv.org/" rel="nofollow">OpenCV Website</a></p> <p><a href="http://docs.opencv.org/2.4/modules/imgproc/doc/geometric_transformations.html" rel="nofollow">They have some very nice documentation too.</a></p>