Patch slir with a grayscale filter
Support grayscale flag in resize function