Rotate an image by 90 degrees Looking for review, good practices, optimizations, clean code tips etc.

final class Pixel {

    private final int color;

    public Pixel(int color) {
        this.color = color;
    }

    public int getColor() {
        return color;
    }
}

/**
 * Rotates an image by ninety degrees.
 * 
 * Complexity:
 * O(row * col)
 */
public final class Rotate {

    private Rotate() { }

    /**
     * Rotes the image in anti clockwise direction.
     * 
     * @param   image the image to be rotated.
     * @return  the titled image.
     * @throws  NPE
     */
    public static Pixel[][] rotateAntiClockWise(Pixel[][] image) {
        int col = image.length;
        int row = image[0].length;

        final Pixel[][] rotatedPixel = new Pixel[row][col];

        for (int i = 0; i &lt; image.length; i++) {
            for (int j = 0; j &lt; image[0].length; j++) {
                rotatedPixel[image[0].length -1 -j][i] = image[i][j];
            }
        }
        return rotatedPixel;
    }


    /**
     * Rotates the image in clockwise direction.
     * 
     * @param   image the image to be rotated.
     * @returns the rotated image.
     * @throws  NPE
     */
   public static Pixel[][] rotateClockWise(Pixel[][] image) {
       int col = image.length;
       int row = image[0].length;

       final Pixel[][] rotatedPixel = new Pixel[row][col];

       for (int i = 0; i &lt; image.length; i++) {
           for (int j = 0; j &lt; image[0].length; j++) {
               rotatedPixel[j][image.length -1 - i] = image[i][j];
           }
       }
       return rotatedPixel;
   }


   public static void main(String[] args) {
       //   int[][] m = { {1, 2, 3, 4} ,
       //                {10, 20, 30, 40}};
       Pixel[][] image = new Pixel[2][4];
       image[0][0] = new Pixel(1);
       image[0][1] = new Pixel(2);
       image[0][2] = new Pixel(3);
       image[0][3] = new Pixel(4);

       image[1][0] = new Pixel(10);
       image[1][1] = new Pixel(20);
       image[1][2] = new Pixel(30);
       image[1][3] = new Pixel(40);

       Pixel[][] rotatedAntiClockNinetyDegreeImage = rotateAntiClockWise(image);

       /*
        * Expected: 
        * 
        * 4  40
        * 3  30
        * 2  20
        * 1  10
        * 
        */
       for (int i = 0; i &lt; rotatedAntiClockNinetyDegreeImage.length; i++) {
           for (int j = 0; j &lt; rotatedAntiClockNinetyDegreeImage[0].length; j++) {
               System.out.print(rotatedAntiClockNinetyDegreeImage[i][j].getColor() + " ");
           }
           System.out.println();
       }

       System.out.println("==========================================");


       Pixel[][] rotatedClockWiseNinetyDegreeImage = rotateClockWise(image);

       /*
        * Expected: 
        * 
        * 10  1 
        * 20  2
        * 30  3
        * 40  4  
        * 
        */
       for (int i = 0; i &lt; rotatedClockWiseNinetyDegreeImage.length; i++) {
           for (int j = 0; j &lt; rotatedClockWiseNinetyDegreeImage[0].length; j++) {
               System.out.print(rotatedClockWiseNinetyDegreeImage[i][j].getColor() + " ");
           }
           System.out.println();
       }
    }
}
Assuming that you will want to do more interesting things with these images later, you should probably come up with a better OOP design.  I suggest:

public interface ImageTransformation {
    public Pixel[][] transform(Pixel[][] image);
}

public class Clockwise90Rotation implements ImageTransformation {
    ...
}

public class AntiClockwise90Rotation implements ImageTransformation {
    ...
}


It's practically no work to rearrange the code that way.  In return, you gain the flexibility to do things like:

ImageTransformation[] pipeline = new ImageTransformation[] {
    new Clockwise90Rotation(),
    new ContrastEnhancer(),
    new GaussianBlur(/* radius= */ 5)
};
for (ImageTransformation t : pipeline) {
    image = t.transform(image);
}