Now I can do Chromakey in GP!
Here's the source image, me (a long time ago) in front of a blue background:
Here's the moon background source:
Here's the script that walks through the pixels and swaps in the moon for a very blue pixel:
And here's the result:
Chromakey
Moderator: MSandro
Chromakey
- Attachments
-
- pixelsMorev2.gp
- (3.74 KiB) Downloaded 403 times
-
- chromakey.gpp
- (1.15 MiB) Downloaded 360 times
Re: Chromakey
Nice! It runs pretty fast on my MacBook Pro, too.
The program is surprisingly short and easy to understand. (Iterating over indices probably requires a bit of explaining to students the first time they see it, but it's an important concept). I love that simple test for "blueness"! I would have written something much more complicated involved hue, saturation, and maybe brightness. Your test is short and intuitive.
The program is surprisingly short and easy to understand. (Iterating over indices probably requires a bit of explaining to students the first time they see it, but it's an important concept). I love that simple test for "blueness"! I would have written something much more complicated involved hue, saturation, and maybe brightness. Your test is short and intuitive.
Re: Chromakey
Short, intuitive -- but surprisingly, not general. In the book, we go through various backgrounds and come up with short rules for them. Most green backgrounds actually have a lot of blue in them, too, so g > b + r isn't a good rule for the green background.
Agreed -- having to use indices makes it a little more complicated to explain. I haven't figured out a better way to explain referencing three different pictures without indices.
Agreed -- having to use indices makes it a little more complicated to explain. I haven't figured out a better way to explain referencing three different pictures without indices.