Make a color semi-transparent

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
mmcc007
Posts: 2
Joined: 2019-01-15T01:37:20-07:00
Authentication code: 1152

Make a color semi-transparent

Post by mmcc007 » 2019-01-15T01:47:20-07:00

I am trying to overlay image1 over image2. I want to make a color in image1 semi-transparent. So far I have only been able to overlay image1 over image2 using

Code: Select all

composite -gravity north image2.png image1.png image3.png
How do I make a color (grey in this case) in image1 semi-transparent before overlaying it over image2?

I am using:

Code: Select all

Version: ImageMagick 7.0.8-23 Q16 x86_64 2019-01-09 https://imagemagick.org
Thnx

snibgo
Posts: 11205
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Make a color semi-transparent

Post by snibgo » 2019-01-15T07:53:07-07:00

What is your platform? I'll assume Windows BAT. If you use bash or Windows CMD, the syntax is different.

I suggest you use "magick", not "composite". Then you can probably do what you want in a single command, something like:

Code: Select all

magick ^
  ( image1.png -fuzz10%% -fill rgba(50%%,50%%,50%%,0.5) -opaque rgba(50%%,50%%,50%%,1) )
  image2.png ^
  -composite ^
  image3.png
snibgo's IM pages: im.snibgo.com

mmcc007
Posts: 2
Joined: 2019-01-15T01:37:20-07:00
Authentication code: 1152

Re: Make a color semi-transparent

Post by mmcc007 » 2019-01-15T17:58:40-07:00

Thnx for the pointers. I ended up following the pointers from the following:
https://stackoverflow.com/questions/541 ... ransparent

Post Reply