add convert and reconvert pixel function; add function for split image on rectangles