add gray_process function