コード例 #1
0
ファイル: mapping.py プロジェクト: REC17/Polonator
 def convertPicPNG(self, pixels, x,y):
     """
         snaps an image and saves the 14bit image as an 8 bit greyscale PNG
         by shifting out 6 bits
     """
     im = Image.new('L', (1000,1000))
     pix = im.load()
     for i in range(1000):
         for j in range(1000):
             pix[j,i] = PC.py_14to8bit(pixels, 1000*i+j)
         # end for
     # end for
     im.save("map_" + str(x) + "_" + str(y) + ".png", "png")
コード例 #2
0
ファイル: testDMD_lib.py プロジェクト: chaoli238/Polonator
def snapPicPNG(exposure, gain, color, filename):
    """
    snaps an image and saves the 14bit image as an 8 bit greyscale PNG
    by shifting out 6 bits
    """
    temp = PC.snap(exposure, gain, color, filename + ".raw")
    im = Image.new('L', (1000,1000))
    pix = im.load()
    for i in range(1000):
        for j in range(1000):
            pix[j,i] = PC.py_14to8bit(temp, 1000*i+j)
        # end for
    # end for
    PC.cameraClose() # also frees up image buffer memory
    im.save(filename + ".png", "png")