pc_program.py

Created by aidanplews2013

Created on September 17, 2020

643 Bytes

copy and paste this code into the python idle make sure the file is saved in the same folder as the image and that you have the python Pillow module installed


import PIL

from PIL import Image

ph=0

ph2=0

l=[]





fram=[]

for oo in range (1):

    #b=str(("0000")+(str((oo*30)+(1))))

    #b=b[-4:]

    #a=("1616ba"+ str(b))

    #fr=Image.open(a+(".png"))

    fr=Image.open("image_14912_eightbit.jpg")

    for i in range (128):

     y=((i))

     for q in range (128):

         x=((q))

         pix=fr.getpixel((x*13,y*13))

         

         if (pix[0])!=0:

             ph=2**q

          



            

         else:

             ph=0

         ph2=int(ph2)+int(ph)

         

     l.append(ph2)

     ph2=0

     ph=0

    fram.append(l)

    l=[]

print(fram)