Up to this point, this project has been implemented strictly in Python. As wonderful as the features and modules available to use for Python are, Python's execution time is slow. Even though interpreted languages are generally slower than an equivalent compiled language, Python is even slower. On average, the execution time of the algorithms in this project have been, at best, ten to twenty times slower than our final solution. This made testing, up to this point, very time consuming. However, without using PIL's file format support and other features within Python, it would have most likely taken at least a month just to develop the file format support and other features we required.
Luckily for us and for Python, there is SWIG. Using SWIG, after we had a good solution, we could write a C or C++ extension which we could call from Python to execute pre-compiled C/C++ code to execute our algorithms very efficiently. Our final solution incorporated our CPU intensive code into a dll, which when wrapped by SWIG, could easily be called from our Python code.
Applying SWIG near the end of this project, brought our Python execution time of over a minute per image down to approximately four seconds an image with our c extension. On average, a stack of notes consisting of ten sheets of paper can be processed in 30 to 40 seconds with full web creation.