问题
I want to watermark an image, so I used compose multiply, but for some reason it doesn't work as expected.
The command:
magick image.jpg over.png -compose multiply -resize 2048x2048 -gravity center -quality 65 -strip -composite out.jpg
The over.png get inverted first and then applied?? If use the same command with and older version of Imagemagick (x32 6.7.6-1 2012-03-17 Q16) I get the expected results. This was tested with x64 ImageMagick 7.0.5 Q16 under Windows 10.
Ah it seems I can't post all the images.
回答1:
After a lot of research, turns out it's an artifact of one of the images being a JPEG in CMYK colorspace. Very weird, but there you go.
Adding '-profile sRGB.icc' to the line should take care of it.
回答2:
FYI your syntax is not proper. You have separated -compose multiply and -composite with -resize. You should do it this way with nothing between them.
magick image.jpg over.png -gravity center -compose multiply -composite -resize 2048x2048 -strip -quality 65 out.jpg
As you said there will be issues if your input JPG is CMYK and your png will always be sRGB. So you do need to convert the CMYK to sRGB before processing.
来源:https://stackoverflow.com/questions/43187807/imagemagick-compose-image-inverted