public Picture picture() {
        if (transposed) {
            transpose();
            transposed = false;
        }
        Picture pic = new Picture(width, height);
        for (int x = 0; x < width; x++) {
            for (int y = 0; y < height; y++) {
                pic.set(x, y, new Color(img[y][x]));
            }
        }
        return pic;
    }