简体   繁体   English

使用ImageMagic融合多个图像

[英]Blend multiple images with ImageMagic

img1 img2

My problem is the following : 我的问题如下:

I have several .png files. 我有几个.png文件。 Each file has a small spot of a certain color. 每个文件都有一个特定颜色的小斑点。 All the files have the same size. 所有文件具有相同的大小。 My question is how to overlay them together so that the spots of different colors will be a mixture of this colors and one color do not overlap completely the other one? 我的问题是如何将它们叠加在一起,以使不同颜色的斑点成为这些颜色的混合,而一种颜色不会与另一种颜色完全重叠? The -flatten option combines images but on the example orange (img1) color will be covered by brown (img2), instead I want a spot of mixing color (brownish). -flatten选项-flatten图像,但是在示例中,橙色(img1)的颜色将被棕色(img2)覆盖,而不是我想要一个混合颜色的点(棕色)。

I tried: 我试过了:

convert -evaluate-sequences mean -- didn't help convert -evaluate-sequences mean -没有帮助

convert -layers merge -- didn't help convert -layers merge -没有帮助

composite -blend -- help, but can combine only two images composite -blend帮助,但只能合并两个图像

Thanks for any tips 谢谢你的提示

Not sure what your images are like, since you only provided 2 whereas I was expecting two input images and one result! 不确定您的图片是什么样的,因为您只提供了2张图片,而我希望提供两张输入图片和一张图片!

So, let's make two of our own: 因此,让我们自己做两个:

convert -size 200x100 xc:none -fill black -draw "circle 80,50 130,50"  black.png
convert -size 200x100 xc:none -fill orange -draw "circle 120,50 170,50"  orange.png

在此处输入图片说明 在此处输入图片说明

Then I guess you want this: 然后我猜你想要这个:

convert orange.png black.png -compose overlay -composite result.png

在此处输入图片说明

Or maybe you mean luminize blend mode: 或者,您的意思是luminize混合模式的luminize

convert orange.png black.png -compose luminize  -composite result.png

在此处输入图片说明

If you want to experiment with other blend modes, you can use: 如果您想尝试其他混合模式,可以使用:

identify -list compose

to get a list of all of them. 以获得所有这些的列表。

Atop
Blend
Blur
Bumpmap
ChangeMask
Clear
ColorBurn
ColorDodge
Colorize
CopyAlpha
CopyBlack
CopyBlue
CopyCyan
CopyGreen
Copy
CopyMagenta
CopyRed
CopyYellow
Darken
DarkenIntensity
DivideDst
DivideSrc
Dst
Difference
Displace
Dissolve
Distort
DstAtop
DstIn
DstOut
DstOver
Exclusion
HardLight
HardMix
Hue
In
Intensity
Lighten
LightenIntensity
LinearBurn
LinearDodge
LinearLight
Luminize
Mathematics
MinusDst
MinusSrc
Modulate
ModulusAdd
ModulusSubtract
Multiply
None
Out
Overlay
Over
PegtopLight
PinLight
Plus
Replace
Saturate
Screen
SoftLight
Src
SrcAtop
SrcIn
SrcOut
SrcOver
VividLight
Xor

If you want to check them all: 如果要全部检查:

for b in $(identify -list compose); do convert -gravity center -pointsize 72 -label "$b" orange.png black.png -compose $b -composite  miff:- ; done | montage -geometry +0+0 miff: montage.png

在此处输入图片说明

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

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