Several Deep Learning Framework Libraries (.e.g PyTorch's TorchVision), Image Processing libraries (.e.g skimage) and machine learning data augmentation libraries (e.g. Augmenter) internally rely on the PIL to perform image transformations.
You can have a situation where in a Semantic Segmentation problem, you have a 3-ch RGB input image, but have a 10-ch mask with each individual channels containing a binary mask of the classes found in the RGB image.
Another situation is when you deal with Geospatial Images, where a TIFF file can contain many channels (8-ch M-Band, 8-ch A-Band) of information corresponding to different spectral bands, for multispectral and hyper-spectral images.
If you use PIL to perform any type of transform, e.g. rescale, it truncates a multi-channel image to a 3-channel image.
There is a related issue #1888, related to PIL not being able to handle high-bit depth images.
I expected PIL to be able to handle multi-channel images.
Any multi-channel image processed by the PIL library gets truncated to 3-channels.
Pillow-5.0.0
Python-3.6.4
The attached file is a binary mask containing 10-channels of binary information in the TIFF file format.
This is how the original image looks like. It was originally in the TIFF file format, but I've converted it to JPEG format for display.

Satellite Imagery (C) DigitalGlobe, Inc.
Thanks for the report, please see:
One way to handle this is to process each channel individually, in parallel, if the number of channels is greater than 3.
I've had to stop using any image transforms that use PIL, in order to overcome this issue, and resort to using simple transformations using numpy at the moment.
See also #2821
Most helpful comment
One way to handle this is to process each channel individually, in parallel, if the number of channels is greater than 3.
I've had to stop using any image transforms that use PIL, in order to overcome this issue, and resort to using simple transformations using numpy at the moment.