Hi all,
I'm hoping someone can help me here.
I have a .jpg that I'd like to overlay with a semi-transparent color (yellow) over the whole image - EXCEPT for a small rectangle (of 60 x 120 pixels) near the top right corner of this image that would NOT have the semi-transparent overlay. Thus, the .jpg as seen through this rectangle would appear without the overlay.
I think that this might involve creating a mask (?) but I'm unsure how to code the command-line for this operation.
OS's that I can test this on are Linux & Windows
Any advice would be welcome.
Thanks.
[SOLVED] transparent overlay minus a rectangle?
- teracow
- Posts: 19
- Joined: 2013-04-30T02:55:12-07:00
- Authentication code: 6789
- Location: Brisbane, Australia
[SOLVED] transparent overlay minus a rectangle?
Last edited by teracow on 2013-05-01T00:53:37-07:00, edited 1 time in total.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: transparent overlay minus a rectangle?
There are many methods, and this probably isn't the best. Windows script:
"rgba(100%%,100%%,0,0.5)" is semi-transparent yellow.
Code: Select all
convert ^
input.jpg ^
( +clone -fill rgba(100%%,100%%,0,0.5) -colorize 100 ) ^
( +clone -fill White -colorize 100 -fill Black -draw "rectangle 400,50,520,170" ) ^
-composite x.png
snibgo's IM pages: im.snibgo.com
- teracow
- Posts: 19
- Joined: 2013-04-30T02:55:12-07:00
- Authentication code: 6789
- Location: Brisbane, Australia
Re: transparent overlay minus a rectangle?
thank you, that's exactly what I wanted!