public void unfilter(byte src[], byte dst[], byte up[])
            throws ImageReadException, IOException
    {
        for (int i = 0; i < src.length; i++)
        {
            int left = 0;
            int prev_index = i - BytesPerPixel;
            if (prev_index >= 0)
                left = dst[prev_index];

            int above = 0;
            if (up != null)
                above = up[i];
            //                above = 255;

            int upperleft = 0;
            if ((prev_index >= 0) && (up != null))
                upperleft = up[prev_index];
            //                upperleft = 255;

            int PaethPredictor = PaethPredictor(0xff & left, 0xff & above,
                    0xff & upperleft);

            dst[i] = (byte) ((src[i] + PaethPredictor) % 256);
            //                dst[i] = (byte) ((src[i] + PaethPredictor) );
            //                dst[i] = src[i];

            //                dst[i] = (byte) 0;
        }
    }