In this method you should create a new image whose pixel positions are rotated 90-degrees counter-clockwise relative to those in the source image.
For example, the diagram below shows a source image of size 6×4 rotated left to create a result image of size 4×6; the pixels are indicated by letters just for illustration. Note that the source image’s width may be different from its height, and that the dimensions of the result image reflect the rotation you have performed; the result image is as wide as the source was tall, and as tall as the source was wide.