Add convert_mode param when saving
Resolves #2663
We don't need to store a map of conversions for each file format. If format supports, for example, only RGB and image in CMYK, we always will do CMYK→ RGB conversion regardless of format. All we need to know is which modes are available for the desired file format. The convert_mode function should just convert from any of source modes to one of the available modes.
Moreover, we could add more internal modes from time to time without touching any plugins.
Okay, I've added a commit. See what you think
In general, this is great. The only drawback for me is binding of supported modes for the save function via the parent's module attribute. In particular, this prevents different sets of supported modes in one module. Isn't better to explicitly assign the supported modes to the save function?
def _save(im, fp, filename):
pass
_save._supported_modes = ['RGB', 'RGBA', 'P', 'I', 'LA', 'L', '1']