Use the power of NumPy to write your own image processing code.
Short answer, it’s written in C, longer answer…
Including full source code.
In this article we see how to fit a straight line to the data in a scatter plot.
Looking at the bigger picture.
Memory, speed, and compatibilty improvements for large data sets.