change invert_data to invert_channels and fix implementation to respect saturation, etc