modified proccessBuffer and convertPix2bin to use pillow instead of PIL