The optimization algorithm is only applicable to the image of mode="P".

Title says it all