Code: Select all
$ uname
Linux
$ convert -v
Version: ImageMagick 7.0.8-5 Q16 x86_64 2018-07-05 https://www.imagemagick.org
$ convert input.jpg sought_options output.jpg
Code: Select all
$ uname
Linux
$ convert -v
Version: ImageMagick 7.0.8-5 Q16 x86_64 2018-07-05 https://www.imagemagick.org
$ convert input.jpg sought_options output.jpg
Code: Select all
magick ^
in.png ^
( +clone -alpha extract -fill gray(25%) ^
-draw "rectangle 0,0 %[fx:w-1],%[fx:h*0.3]" ^
) ^
-alpha off -compose CopyOpacity -composite ^
out.png
Code: Select all
$ uname
Linux
$ convert -v
Version: ImageMagick 7.0.8-5 Q16 x86_64 2018-07-05 https://www.imagemagick.org
Your answer looks intriguing, but I cannot replicate your solution due to working on a different platform. What would the equivalent command be for the lastest IM version under Linux? I am working with ImageMagick 7.0.8-5 on Linux.snibgo wrote: ↑2018-07-06T15:46:39-07:00 What version of IM, on what platform? I'll assume v7 on Windows CMD.
Assuming you want to set opacity in that area to 25% (so we don't care what it used to be):
Code: Select all
magick ^ in.png ^ ( +clone -alpha extract -fill gray(25%) ^ -draw "rectangle 0,0 %[fx:w-1],%[fx:h*0.3]" ^ ) ^ -alpha off -compose CopyOpacity -composite ^ out.png
Code: Select all
magick \
in.png \
\( +clone -alpha extract -fill "gray(25%)" \
-draw "rectangle 0,0 %[fx:w-1],%[fx:h*0.3]" \
\) \
-alpha off -compose CopyOpacity -composite \
out.png
Yes, that is what I was looking for! Thank you.fmw42 wrote: ↑2018-07-06T16:51:18-07:00 In Unix syntax that would be:
Code: Select all
magick \ in.png \ \( +clone -alpha extract -fill "gray(25%)" \ -draw "rectangle 0,0 %[fx:w-1],%[fx:h*0.3]" \ \) \ -alpha off -compose CopyOpacity -composite \ out.png
Code: Select all
magick in.png -region %[fx:w]x%[fx:h*0.3]+0+0 -channel A -evaluate set 25% +channel out.png