Image pixellation code for MATLAB