Example #1
0
#then import the image (already grayscaled)
target=ImgIO.readFile('target3.jpg')

(x,y)=target.shape


#new array:
img=np.ndarray((x,y,50,50),dtype=np.uint8)
map=intensity.toTuple(all)

for i in range(len(target)):
    for j in range(len(target[i])):
        #print (i,j)
        targetedPixel=target[i][j]
        tile=intensity.findTile(targetedPixel, map)
        #arraywise copying:
        print 'procesando pixel:'+str((i,j))
        #print tile[m][n]
        img[i][j]=tile
g=np.concatenate((img),axis=1)
g=np.concatenate((g),axis=1)
print g.shape
print g
ImgIO.writeImg(g,'/home/johan/Desktop/brian.jpg')



        

        
    
Example #2
0
for i in range(len(target)):
    for j in range(len(target[i])):
        #print (i,j)
        targetedPixel=target[i][j]
        tile=intensity.mapFind(targetedPixel, map)
        #pixelwise copying:
        for m in range(len(tile)):
            for n in range(len(tile[m])):
                print 'processando pixel:'+str((i*50+m,j*50+n))
                #print tile[m][n]
                image[i*50+m][j*50+n]=tile[m][n]
#c is a 4d array
#g=np.concatenate((c),axis=1)
#g=np.concatenate((g),axis=1)

ImgIO.writeImg(image,'g.jpg')



#(x,y)=target.shape
#
#col=None
#
#for i in range(len(target)):
#    row=None
#    #loop through row:
#    for j in range(len(target[i])):
#        #first find the intensity of a pixel
#        key=target[i][j]
#        #this obj contains the image
#        image=None