0

I'm using the command below to overlay an image (../esrgan/{1}) with another image ({1}) that I scale to 400% and then apply lighten composition to.

parallel --bar --xapply convert {1} -filter Lanczos -resize 400% ../esrgan/{1} +swap -compose Lighten -composite ../esrgan/{1} ::: *.png

On top of that, I also want to set the opacity of the top layer ({1}) to 75%. How do I do that?

1 Answer 1

3

I'm not familiar with your complete syntax there, but within the part that is appears to be an ImageMagick command, right after the "-resize" and before reading in the second image, add this to the code...

... -channel A -evaluate set 75% +channel ...

That tells the command to only use the alpha channel for the following operation(s). The "-evaluate" operation sets the alpha channel to a value of 75%. Then the "+channel" with the plus "+" ends that special setting and continues with the command.

If the first input file doesn't have an alpha channel, you can add "-alpha set" to make sure the image has an alpha channel before changing the value.

1
  • 1
    Nice answer! The other syntax is GNU Parallel, btw. It just means apply the convert in parallel to all images named after the ::: Commented Feb 21 at 10:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.