Python script for binarizing color images