This blog post points out some pitfalls when using image preprocessing steps in your machine learning pipeline, using Pillow/OpenCV/PyTorch and Tensorflow as examples. There are implementation details that might lead to significant performance differences when moving to production.