简体   繁体   English

如何在Python魔杖中倍增图像?

[英]How to multiply images in Python Wand?

I'm currently writing a script to generate some textures according to color schemes for a project of mine, and one of the things I need to do is "multiply" the image, much like the layering mode that you can find in Gimp or Photoshop. 我目前正在编写一个脚本,以根据我的项目的配色方案生成一些纹理,我要做的一件事情是“乘以”图像,就像在Gimp或Photoshop中可以找到的分层模式一样。

However, I'm having trouble figuring out how to do this under Wand. 但是,我在弄清楚如何在Wand下执行此操作时遇到了麻烦。 I know that ImageMagick provides the ability to multiply images by running the composite command with the compose flag. 我知道ImageMagick提供了通过运行带有compose标志的Composite命令来倍增图像的功能。 However, the equivalent in Wand, Image.composite, does not provide any options aside from the second image and the upper-left coordinates, so it only copies and pastes on top of the underlying image. 但是,Wand中的等效项Image.composite除了第二个图像和左上角的坐标外,没有提供任何其他选项,因此它仅复制和粘贴在基础图像的顶部。

Am I missing something, or are there better options available? 我是否缺少某些东西,或者有更好的选择吗?

您是否尝试过Image.composite_channel()方法?

I dug further. 我进一步挖掘。 As far as I can tell, Wand does not support this kind of functionality. 据我所知,Wand不支持这种功能。 So instead I've gone with Pillow, a fork of the Python Imaging Library: https://pypi.python.org/pypi/Pillow 因此,我选择了Python Imaging Library的一个分支Pillow: https : //pypi.python.org/pypi/Pillow

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM