コード例 #1
0
ファイル: main.py プロジェクト: salmonandrew/WhiteChristmas
        for vertex in face.bounding_poly.vertices
    ])

    print('face bounds: {}'.format(','.join(vertices)))
    print(type(face.bounding_poly.vertices))
    xValues = []
    yValues = []

    for vertex in face.bounding_poly.vertices:
        xValues.append((vertex.x))
        yValues.append((vertex.y))

    print(xValues)
    print(yValues)
    width = xValues[1] - xValues[0]
    height = yValues[2] - yValues[1]
    size = (width, height)

overlay = os.path.join(os.path.dirname(__file__), 'images/bing.jpg')

image1 = Image.open(file_name)
image2 = Image.open(overlay)

image2 = image2.resize(size)

image1.paste(image2, (xValues[0], yValues[0]))

image1.show()

BingSearch.GetImage('balloon')
コード例 #2
0
from PIL import Image
import BingSearch
import pyperclip
import helpers

path1 = helpers.getImagePath('test2.jpg')

BingSearch.GetImage('walnut')

path2 = helpers.getImagePath('bing.jpg')

image = helpers.objOnFace(path1, path2)

image.show()