don't forget to free memory

Tested on darcy.

working on pure python fractal
===============================
Fri Jun 13 05:45:12 2014    pure.prof

         13105318 function calls (13105317 primitive calls) in 53.978 seconds

   Ordered by: internal time
   List reduced from 114 to 10 due to restriction <10>

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
  1703936   40.672    0.000   41.421    0.000 FractalTransform.py:193(place_point)
  1419417    2.184    0.000    2.184    0.000 FractalTransform.py:148(Transform)
  1703936    1.785    0.000    1.785    0.000 FractalTransform.py:19(quickrand32)
        1    1.781    1.781   53.306   53.306 FractalTransform.py:202(Simulate)
  1703936    1.737    0.000   10.102    0.000 FractalTransform.py:179(Transform)
   284519    1.642    0.000    2.597    0.000 FractalTransform.py:83(Transform)
   284519    1.262    0.000    4.396    0.000 FractalTransform.py:103(Transform)
  3708808    0.829    0.000    0.829    0.000 {math.sqrt}
   284519    0.748    0.000    0.955    0.000 FractalTransform.py:56(Transform)
        1    0.556    0.556    0.562    0.562 FractalTransform.py:229(get_colors)

working on old fractal
======================
maxa 1638400.0 factor 3.0517578125e-07
log(factor*maxa) -0.69314718056
Fri Jun 13 05:46:02 2014    old.prof

         7385856 function calls in 1.961 seconds

   Ordered by: internal time
   List reduced from 58 to 10 due to restriction <10>

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
  1703936    0.612    0.000    1.021    0.000 OldFractalTransform.pyx:176(multipleTransform)
        1    0.591    0.591    1.811    1.811 OldFractalTransform.pyx:194(Simulate)
  1703936    0.199    0.000    0.199    0.000 OldFractalTransform.pyx:182(place_point)
   284519    0.133    0.000    0.211    0.000 OldFractalTransform.pyx:100(fancyTransform)
        1    0.130    0.130    0.130    0.130 OldFractalTransform.pyx:222(get_colors)
  1703936    0.108    0.000    0.108    0.000 OldFractalTransform.pyx:17(quickrand32)
  1419417    0.089    0.000    0.089    0.000 OldFractalTransform.pyx:141(symmetryTransform)
   284519    0.059    0.000    0.078    0.000 OldFractalTransform.pyx:76(affineTransform)
   284519    0.019    0.000    0.019    0.000 OldFractalTransform.pyx:48(colorTransform)
        1    0.018    0.018    1.961    1.961 OldFractalTransform.pyx:270(Image)

maxa 6789.0 factor 0.448584177656
log(factor*maxa) 8.02140000629

working on optimized fractal
============================
Fri Jun 13 05:46:17 2014    opt.prof

         1537 function calls in 14.639 seconds

   Ordered by: internal time
   List reduced from 57 to 10 due to restriction <10>

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1   14.003   14.003   14.003   14.003 {method 'Simulate' of 'VisualHashPrivate.OptimizedFractalTransform.Multiple' objects}
        1    0.523    0.523    0.523    0.523 {VisualHashPrivate.OptimizedFractalTransform.get_colors}
        1    0.112    0.112   14.639   14.639 __init__.py:199(OptimizedFractal)
       22    0.000    0.000    0.000    0.000 {numpy.core.multiarray.array}
      115    0.000    0.000    0.000    0.000 __init__.py:79(random32)
       65    0.000    0.000    0.000    0.000 random.py:558(gauss)
       33    0.000    0.000    0.001    0.000 defmatrix.py:233(__new__)
      129    0.000    0.000    0.000    0.000 {range}
       22    0.000    0.000    0.000    0.000 {built-in method __new__ of type object at 0x887160}
      115    0.000    0.000    0.001    0.000 __init__.py:90(random)

profiling old fractal algorithm took 53.89 seconds
pure python fractal algorithm took 48.21 seconds
profiling old fractal algorithm took 1.96 seconds
old fractal algorithm took 0.41 seconds
profiling optimized fractal algorithm took 14.62 seconds
optimized fractal algorithm took 14.64 seconds
fix printing typo and refactor size into variable

Tested on darcy.

working on pure python fractal
===============================
Fri Jun 13 05:49:00 2014    pure.prof

         13105318 function calls (13105317 primitive calls) in 50.720 seconds

   Ordered by: internal time
   List reduced from 114 to 10 due to restriction <10>

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
  1703936   37.556    0.000   38.303    0.000 FractalTransform.py:193(place_point)
  1419417    2.183    0.000    2.183    0.000 FractalTransform.py:148(Transform)
        1    1.805    1.805   50.062   50.062 FractalTransform.py:202(Simulate)
  1703936    1.755    0.000    9.951    0.000 FractalTransform.py:179(Transform)
  1703936    1.751    0.000    1.751    0.000 FractalTransform.py:19(quickrand32)
   284519    1.488    0.000    2.444    0.000 FractalTransform.py:83(Transform)
   284519    1.259    0.000    4.262    0.000 FractalTransform.py:103(Transform)
  3708808    0.830    0.000    0.830    0.000 {math.sqrt}
   284519    0.744    0.000    0.956    0.000 FractalTransform.py:56(Transform)
        1    0.548    0.548    0.554    0.554 FractalTransform.py:229(get_colors)

working on old fractal
======================
maxa 1638400.0 factor 3.0517578125e-07
log(factor*maxa) -0.69314718056
Fri Jun 13 05:49:49 2014    old.prof

         7385856 function calls in 2.200 seconds

   Ordered by: internal time
   List reduced from 58 to 10 due to restriction <10>

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
  1703936    0.706    0.000    1.173    0.000 OldFractalTransform.pyx:176(multipleTransform)
        1    0.671    0.671    2.061    2.061 OldFractalTransform.pyx:194(Simulate)
  1703936    0.217    0.000    0.217    0.000 OldFractalTransform.pyx:182(place_point)
   284519    0.140    0.000    0.229    0.000 OldFractalTransform.pyx:100(fancyTransform)
  1703936    0.126    0.000    0.126    0.000 OldFractalTransform.pyx:17(quickrand32)
        1    0.120    0.120    0.120    0.120 OldFractalTransform.pyx:222(get_colors)
  1419417    0.112    0.000    0.112    0.000 OldFractalTransform.pyx:141(symmetryTransform)
   284519    0.066    0.000    0.089    0.000 OldFractalTransform.pyx:76(affineTransform)
   284519    0.023    0.000    0.023    0.000 OldFractalTransform.pyx:48(colorTransform)
        1    0.017    0.017    2.200    2.200 OldFractalTransform.pyx:270(Image)

maxa 6789.0 factor 0.448584177656
log(factor*maxa) 8.02140000629

working on optimized fractal
============================
Fri Jun 13 05:50:04 2014    opt.prof

         1537 function calls in 14.596 seconds

   Ordered by: internal time
   List reduced from 57 to 10 due to restriction <10>

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1   13.973   13.973   13.973   13.973 {method 'Simulate' of 'VisualHashPrivate.OptimizedFractalTransform.Multiple' objects}
        1    0.520    0.520    0.520    0.520 {VisualHashPrivate.OptimizedFractalTransform.get_colors}
        1    0.101    0.101   14.596   14.596 __init__.py:199(OptimizedFractal)
       22    0.000    0.000    0.000    0.000 {numpy.core.multiarray.array}
      115    0.000    0.000    0.000    0.000 __init__.py:79(random32)
       65    0.000    0.000    0.000    0.000 random.py:558(gauss)
      129    0.000    0.000    0.000    0.000 {range}
       33    0.000    0.000    0.001    0.000 defmatrix.py:233(__new__)
       22    0.000    0.000    0.000    0.000 {built-in method __new__ of type object at 0x887160}
       44    0.000    0.000    0.000    0.000 defmatrix.py:301(__getitem__)

profiling pure fractal algorithm took 50.64 seconds
pure python fractal algorithm took 46.66 seconds
profiling old fractal algorithm took 2.19 seconds
old fractal algorithm took 0.41 seconds
profiling optimized fractal algorithm took 14.57 seconds
optimized fractal algorithm took 14.46 seconds
initialize arrays since PyMem_Malloc does not zero

Tested on darcy.

working on pure python fractal
===============================
Fri Jun 13 06:39:55 2014    pure.prof

         13105318 function calls (13105317 primitive calls) in 76.730 seconds

   Ordered by: internal time
   List reduced from 114 to 10 due to restriction <10>

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
  1703936   56.430    0.000   57.715    0.000 FractalTransform.py:193(place_point)
  1419417    3.122    0.000    3.122    0.000 FractalTransform.py:148(Transform)
        1    2.882    2.882   75.725   75.725 FractalTransform.py:202(Simulate)
  1703936    2.588    0.000   15.124    0.000 FractalTransform.py:179(Transform)
  1703936    2.460    0.000    2.460    0.000 FractalTransform.py:19(quickrand32)
   284519    2.457    0.000    3.996    0.000 FractalTransform.py:83(Transform)
   284519    1.974    0.000    6.954    0.000 FractalTransform.py:103(Transform)
  3708808    1.423    0.000    1.423    0.000 {math.sqrt}
   284519    1.200    0.000    1.539    0.000 FractalTransform.py:56(Transform)
        1    0.839    0.839    0.850    0.850 FractalTransform.py:229(get_colors)

working on old fractal
======================
maxa 6789.0 factor 0.448584177656
log(factor*maxa) 8.02140000629
Fri Jun 13 06:41:06 2014    old.prof

         7385856 function calls in 2.721 seconds

   Ordered by: internal time
   List reduced from 58 to 10 due to restriction <10>

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1    0.855    0.855    2.634    2.634 OldFractalTransform.pyx:194(Simulate)
  1703936    0.849    0.000    1.429    0.000 OldFractalTransform.pyx:176(multipleTransform)
  1703936    0.350    0.000    0.350    0.000 OldFractalTransform.pyx:182(place_point)
   284519    0.192    0.000    0.306    0.000 OldFractalTransform.pyx:100(fancyTransform)
  1703936    0.150    0.000    0.150    0.000 OldFractalTransform.pyx:17(quickrand32)
  1419417    0.124    0.000    0.124    0.000 OldFractalTransform.pyx:141(symmetryTransform)
   284519    0.086    0.000    0.114    0.000 OldFractalTransform.pyx:76(affineTransform)
        1    0.065    0.065    0.065    0.065 OldFractalTransform.pyx:222(get_colors)
   284519    0.028    0.000    0.028    0.000 OldFractalTransform.pyx:48(colorTransform)
        1    0.020    0.020    2.721    2.721 OldFractalTransform.pyx:273(Image)

maxa 6789.0 factor 0.448584177656
log(factor*maxa) 8.02140000629

working on optimized fractal
============================
Fri Jun 13 06:41:26 2014    opt.prof

         1537 function calls in 19.960 seconds

   Ordered by: internal time
   List reduced from 57 to 10 due to restriction <10>

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1   19.348   19.348   19.348   19.348 {method 'Simulate' of 'VisualHashPrivate.OptimizedFractalTransform.Multiple' objects}
        1    0.513    0.513    0.513    0.513 {VisualHashPrivate.OptimizedFractalTransform.get_colors}
        1    0.095    0.095   19.960   19.960 __init__.py:199(OptimizedFractal)
       22    0.001    0.000    0.001    0.000 {numpy.core.multiarray.array}
      115    0.000    0.000    0.001    0.000 __init__.py:79(random32)
       65    0.000    0.000    0.001    0.000 random.py:558(gauss)
       33    0.000    0.000    0.001    0.000 defmatrix.py:233(__new__)
       22    0.000    0.000    0.000    0.000 {built-in method __new__ of type object at 0x887160}
      129    0.000    0.000    0.000    0.000 {range}
       44    0.000    0.000    0.000    0.000 defmatrix.py:301(__getitem__)

profiling pure fractal algorithm took 76.39 seconds
pure python fractal algorithm took 67.82 seconds
profiling old fractal algorithm took 2.71 seconds
old fractal algorithm took 0.58 seconds
profiling optimized fractal algorithm took 19.84 seconds
optimized fractal algorithm took 17.03 seconds
make bigger image in test, and do not test pure python code

Tested on darcy.

working on old fractal
======================
maxa 12933.0 factor 0.844601347323
log(factor*maxa) 9.29864692215
Fri Jun 13 07:15:55 2014    old.prof

         29535543 function calls (29535542 primitive calls) in 8.143 seconds

   Ordered by: internal time
   List reduced from 98 to 10 due to restriction <10>

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1    2.708    2.708    7.885    7.885 OldFractalTransform.pyx:194(Simulate)
  6815744    2.532    0.000    4.183    0.000 OldFractalTransform.pyx:176(multipleTransform)
  6815744    0.994    0.000    0.994    0.000 OldFractalTransform.pyx:182(place_point)
  1135580    0.538    0.000    0.852    0.000 OldFractalTransform.pyx:100(fancyTransform)
  6815744    0.435    0.000    0.435    0.000 OldFractalTransform.pyx:17(quickrand32)
  5680164    0.364    0.000    0.364    0.000 OldFractalTransform.pyx:141(symmetryTransform)
  1135580    0.233    0.000    0.314    0.000 OldFractalTransform.pyx:76(affineTransform)
        1    0.176    0.176    0.176    0.176 OldFractalTransform.pyx:222(get_colors)
  1135580    0.080    0.000    0.080    0.000 OldFractalTransform.pyx:48(colorTransform)
        1    0.080    0.080    8.143    8.143 OldFractalTransform.pyx:273(Image)

maxa 12933.0 factor 0.844601347323
log(factor*maxa) 9.29864692215

working on optimized fractal
============================
Fri Jun 13 07:16:55 2014    opt.prof

         1665 function calls in 57.871 seconds

   Ordered by: internal time
   List reduced from 57 to 10 due to restriction <10>

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1   55.525   55.525   55.525   55.525 {method 'Simulate' of 'VisualHashPrivate.OptimizedFractalTransform.Multiple' objects}
        1    1.952    1.952    1.952    1.952 {VisualHashPrivate.OptimizedFractalTransform.get_colors}
        1    0.392    0.392   57.871   57.871 __init__.py:199(OptimizedFractal)
      257    0.000    0.000    0.000    0.000 {range}
       22    0.000    0.000    0.000    0.000 {numpy.core.multiarray.array}
        1    0.000    0.000   57.871   57.871 <string>:1(<module>)
      115    0.000    0.000    0.000    0.000 __init__.py:79(random32)
       65    0.000    0.000    0.000    0.000 random.py:558(gauss)
       33    0.000    0.000    0.001    0.000 defmatrix.py:233(__new__)
        1    0.000    0.000    0.000    0.000 {PIL._imaging.fill}

profiling old fractal algorithm took 8.14 seconds
old fractal algorithm took 1.7 seconds
profiling optimized fractal algorithm took 57.76 seconds
optimized fractal algorithm took 56.91 seconds
manually inline multipleTransform for speed

Tested on darcy.

working on old fractal
======================
maxa 12933.0 factor 0.844601347323
log(factor*maxa) 9.29864692215
Fri Jun 13 07:26:26 2014    old.prof

         22719799 function calls (22719798 primitive calls) in 6.012 seconds

   Ordered by: internal time
   List reduced from 97 to 10 due to restriction <10>

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1    3.214    3.214    5.754    5.754 OldFractalTransform.pyx:194(Simulate)
  6815744    0.916    0.000    0.916    0.000 OldFractalTransform.pyx:182(place_point)
  1135580    0.537    0.000    0.863    0.000 OldFractalTransform.pyx:100(fancyTransform)
  6815744    0.400    0.000    0.400    0.000 OldFractalTransform.pyx:17(quickrand32)
  5680164    0.361    0.000    0.361    0.000 OldFractalTransform.pyx:141(symmetryTransform)
  1135580    0.241    0.000    0.326    0.000 OldFractalTransform.pyx:76(affineTransform)
        1    0.170    0.170    0.170    0.170 OldFractalTransform.pyx:233(get_colors)
        1    0.086    0.086    6.012    6.012 OldFractalTransform.pyx:284(Image)
  1135580    0.085    0.000    0.085    0.000 OldFractalTransform.pyx:48(colorTransform)
      115    0.000    0.000    0.001    0.000 __init__.py:79(random32)

maxa 12933.0 factor 0.844601347323
log(factor*maxa) 9.29864692215

working on optimized fractal
============================
Fri Jun 13 07:27:24 2014    opt.prof

         1665 function calls in 56.579 seconds

   Ordered by: internal time
   List reduced from 57 to 10 due to restriction <10>

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1   54.076   54.076   54.076   54.076 {method 'Simulate' of 'VisualHashPrivate.OptimizedFractalTransform.Multiple' objects}
        1    2.101    2.101    2.101    2.101 {VisualHashPrivate.OptimizedFractalTransform.get_colors}
        1    0.399    0.399   56.578   56.578 __init__.py:199(OptimizedFractal)
       22    0.000    0.000    0.000    0.000 {numpy.core.multiarray.array}
      257    0.000    0.000    0.000    0.000 {range}
        1    0.000    0.000   56.579   56.579 <string>:1(<module>)
      115    0.000    0.000    0.000    0.000 __init__.py:79(random32)
       33    0.000    0.000    0.001    0.000 defmatrix.py:233(__new__)
       65    0.000    0.000    0.000    0.000 random.py:558(gauss)
        1    0.000    0.000    0.000    0.000 {PIL._imaging.fill}

profiling old fractal algorithm took 6.01 seconds
old fractal algorithm took 1.33 seconds
profiling optimized fractal algorithm took 56.49 seconds
optimized fractal algorithm took 57.95 seconds