public Color get(int x, int y) {
        if (x < 0 || x >= width())  throw new IndexOutOfBoundsException("x must be between 0 and " + (width()-1));
        if (y < 0 || y >= height()) throw new IndexOutOfBoundsException("y must be between 0 and " + (height()-1));
        if (isOriginUpperLeft) return new Color(image.getRGB(x, y));
        else                   return new Color(image.getRGB(x, height - y - 1));
    }