Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Processsing 中是否有可用于将图像添加和叠加到另一个图像上的功能?
因此,例如,我可以将 2 个图像加载到 2 个单独的 PImage 中,如下所示:
PImage image1 = loadImage("imagefile1.jpg"); PImage image2 = loadImage(imagefile2.jpg");
现在,我如何添加image2到image1看起来image2像在顶部image1,然后将整个编辑的图像保存image1为新图像?
image2
image1
当然有!只需复制:
image1.copy(image2, 0, 0, image2.width, image2.height, 0, 0, image2.width, image2.height); image1.save("copied.jpg");
或者如果你想混合它们......
image1.blend(image2, 0, 0, image2.width, image2.height, 0, 0, image2.width, image2.height, ADD); image1.save("blended.jpg");