In [1]:
%pylab inline
pylab.rcParams['figure.figsize'] = (15, 10)


Populating the interactive namespace from numpy and matplotlib

In [2]:
figure(figsize=(20,10))


Out[2]:
<matplotlib.figure.Figure at 0x7f2b05b78e10>
<matplotlib.figure.Figure at 0x7f2b05b78e10>

In [3]:
img = zeros(shape=(1024,1024,3))
Y, X = ogrid[0:1024,0:1024]

In [4]:
img = zeros(shape=(1024,1024,3))
for y in range(1,1024):
    for x in range(1,1024):
        img[y,x,0] = (y%x)&(x%y)
        img[y,x,1] = (y%x)+(x%y)
        img[y,x,2] = (y%x)|(x%y)
#img /= 1024.
imshow(img);



In [5]:
img = zeros(shape=(1024,1024,3))
img[:,:,0]=(Y%X)&(X%Y)
img[:,:,1]=(Y%X)+(X%Y)
img[:,:,2]=(Y%X)|(X%Y)
imshow(img);


/usr/local/lib/python2.7/dist-packages/ipykernel/__main__.py:2: RuntimeWarning: divide by zero encountered in remainder
  from ipykernel import kernelapp as app
/usr/local/lib/python2.7/dist-packages/ipykernel/__main__.py:3: RuntimeWarning: divide by zero encountered in remainder
  app.launch_new_instance()
/usr/local/lib/python2.7/dist-packages/ipykernel/__main__.py:4: RuntimeWarning: divide by zero encountered in remainder

In [6]:
s=3./(Y+99);
DIM = 1024.
y=(Y+sin((X*X+(Y-700)**2*5)/100./DIM)*35)*s;
img[:,:,0] = ((X+DIM)*s+y).astype(int)%2 + ((DIM*2-X)*s+y).astype(int)%2
img[:,:,1] = (5*((X+DIM)*s+y)).astype(int)%2 + (5*((DIM*2-X)*s+y)).astype(int)%2
img[:,:,2] = (29*((X+DIM)*s+y)).astype(int)%2 + (29*((DIM*2-X)*s+y)).astype(int)%2
img/=2
imshow(img);



In [7]:
img = zeros(shape=(1024,1024,3))
img[:,:,0] = ((100*sin((X+400)*(Y+100)/11115)).astype(int))&X
img[:,:,1] = img[:,:,0]
img[:,:,2] = img[:,:,0]
imshow(img);



In [8]:
img = zeros(shape=(1024,1024,3))
x=y=0.
for k in range(15):
    x, y = (sin(x)) - cos(y)**2 +(X-512.)/512, 2*sin(x)*cos(y)+(Y-512.0)/512;
img[:,:,0] = x**2+y**2
img[:,:,1] = 15*abs(x)
img[:,:,2] = 15*abs(y)
imshow(img/2);



In [44]:
I = X[:, 512-246:512+246]
J = Y[ 512-246:512+246, :]
img = zeros(shape=(J.shape[0], I.shape[1], 3))
sv = vectorize(lambda xx, i:ord(xx[i]))
def g(S):
    return right_shift(sv(S, I/29%18*2+J/29/8%2), J/29%8)&1
img[:,:,0] = g("\xF3\xF2\xF2\x10\xF4\0\xF2\x10\xE1\xE0\x81\0\x80\0\x80\0\0\0\0\0@\0! \x03d8,=\x2C\x99\x84\xC3\x82\xE1\xE3")
img[:,:,2] = g("\363\360\362\20\364\0\362\20\341\340\200\0\200\0\200\0\0\0\0\0\0\0\0\0\0\08\0<\0\230\0\300\0\341\340")/2.0
img[:,:,1] = maximum(g(";\376z\34\377\374\372\30k\360\3\200\0\0\0\0\0\0\200\0\300\0\341 \373d\307\354\303\374e\374;\376;\377"), img[:,:,2])
imshow(img);


Out[44]:
<matplotlib.image.AxesImage at 0x7f2b04102a90>

In [ ]: