使用谷歌应用引擎和python合并2个图像?

Lov*_*rma 5 python google-app-engine python-imaging-library

我想在第一张图像的特定位置合并2张图像.

示例:第1张图像:x.png(400 X 400px)第2张图像:( y.png100,100坐标处)

我怎么能在google appengine中使用python来做到这一点.

如果您可以为此提供一些代码......或者对此代码的任何引用...将不胜感激.

谢谢,请让我知道更多说明.

Ste*_*yne 13

这可以使用非常简化的成像库来完成,该库模拟PIL的一些功能.你需要的功能是复合的

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
Run Code Online (Sandbox Code Playgroud)