Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/358.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用google app engine和python合并2个图像?_Python_Google App Engine_Python Imaging Library - Fatal编程技术网

使用google app engine和python合并2个图像?

使用google app engine和python合并2个图像?,python,google-app-engine,python-imaging-library,Python,Google App Engine,Python Imaging Library,我想合并2个图像,也就是在第一个图像的特定位置 例如: 第一幅图像:x.png(400 x 400px) 第二幅图像:y.png(位于100100坐标处) 如何在google appengine中使用python实现这一点 如果你能提供一些代码。。。或对该代码的任何引用。。。将不胜感激 谢谢,, 请让我知道更多的澄清。尝试composite方法:您可以查看google images api中的composite模块。如果它不起作用。这也值得一试。这是在python中使用图像模块 import I

我想合并2个图像,也就是在第一个图像的特定位置

例如: 第一幅图像:
x.png
(400 x 400px) 第二幅图像:
y.png
(位于
100100
坐标处)

如何在google appengine中使用python实现这一点

如果你能提供一些代码。。。或对该代码的任何引用。。。将不胜感激

谢谢,,
请让我知道更多的澄清。

尝试
composite
方法:

您可以查看google images api中的composite模块。如果它不起作用。这也值得一试。这是在python中使用图像模块

import Image
image1 = Image.open("#imageurl")
iamge2 = Image.open("#imageurl")

image1.paste(image2, (0, 0), image2)

这可以使用非常精简的图像库来完成,该库模拟PIL的一些功能。您需要的功能是


不会的;您不能在应用程序引擎中直接使用PIL。您只能使用AppEngine的imaging API(或者,如果您可以找到的话,可以使用纯python代码来处理图像)。
from google.appengine.api import images

xpng = #Load data from x.png here, or read from BlobProperty
ypng = #Load data from y.png here, or read from BlobProperty

composite = images.composite([(xpng, 0, 0, 1.0, images.TOP_LEFT),
    (ypng, 100, 100, 1.0, images.TOP_LEFT)], 400, 400)

#composite now holds your new image data, to do what you want with