finish adjusting convert grey8 function