@Override
    public int getPixel(int x, int y)
    {
        if (x < 0 || x >= width)
            return 0;
        if (y < 0 || y >= height)
            return 0;
        int val = getPixelVal(x, y);
        if (format == 1)
            val &= 0x1F;
        if (format == 6)
            val &= 0x07;
        return val;
    }