Apply dilation based on current row of image.