color distribution plot
[imago.git] / imago.py
index 4b87f0f..136574a 100755 (executable)
--- a/imago.py
+++ b/imago.py
@@ -94,7 +94,18 @@ def main():
                 draw.line(l, fill=(64, 255, 64), width=1)
             do_something(im_g, "grid", name="grid")
 
-    board = intrsc.board(image, lines, show_all, do_something)
+    board, board_raw = intrsc.board(image, lines, show_all, do_something)
+
+    ### Show color distribution
+    #import matplotlib.pyplot as pyplot
+    #luma = [(0.30 * s[0] + 0.59 * s[1] + 0.11 * s[2]) / 255.
+    #             for s in sum(board_raw, [])]
+    #pyplot.scatter(luma,
+    #            [(max(s) - min(s)) / (255 - abs(max(s) + min(s) - 255))
+    #             for s in sum(board_raw, [])],  
+    #               color=[(s[0]/255., s[1]/255., s[2]/255., 1.) for s in sum(board_raw, [])])
+    #pyplot.show()
+    ###
 
     #simple ASCII output:
     for line in board: