convert to gray after cropping, update get cell function