from PIL import Image
im = Image.new ( 'RGB' , ( 3600 , 3600 ) )
pi = im.load ( )
pi1 = Image.open ( 'pic1.png' ) .load ( )
pi2 = Image.open ( 'pic2.png' ) .load ( )
for i in range ( 3600 ) :
for j in range ( 3600 ) :
if 5 <= i % 12 <= 6 and 5 <= j % 12 <= 6 :
r, g, b = map ( lambda t: int ( t * 0.796875 + 0.5 ) , pi1[ ( i // 12 , j // 12 ) ] )
pi[ ( i, j) ] = ( r, g, b)
if i % 45 == 22 and j % 45 == 22 :
pi[ ( i, j) ] = pi2[ ( i // 45 , j // 45 ) ]
im.save ( 'pic.png' , optimize= True )
ZnJvbSBQSUwgaW1wb3J0IEltYWdlCgppbSA9IEltYWdlLm5ldygnUkdCJywgKDM2MDAsIDM2MDApKQpwaSA9IGltLmxvYWQoKQpwaTEgPSBJbWFnZS5vcGVuKCdwaWMxLnBuZycpLmxvYWQoKQpwaTIgPSBJbWFnZS5vcGVuKCdwaWMyLnBuZycpLmxvYWQoKQoKZm9yIGkgaW4gcmFuZ2UoMzYwMCk6Cglmb3IgaiBpbiByYW5nZSgzNjAwKToKCQlpZiA1IDw9IGkgJSAxMiA8PSA2IGFuZCA1IDw9IGogJSAxMiA8PSA2OgoJCQlyLCBnLCBiID0gbWFwKGxhbWJkYSB0OiBpbnQodCAqIDAuNzk2ODc1ICsgMC41KSwgcGkxWyhpIC8vIDEyLCBqIC8vIDEyKV0pCgkJCXBpWyhpLGopXSA9IChyLCBnLCBiKQoJCWlmIGkgJSA0NSA9PSAyMiBhbmQgaiAlIDQ1ID09IDIyOgoJCQlwaVsoaSxqKV0gPSBwaTJbKGkgLy8gNDUsIGogLy8gNDUpXQoKaW0uc2F2ZSgncGljLnBuZycsIG9wdGltaXplPVRydWUp