functions luma, luminance and replace implemented.