Page 1 of 1
Chromakey
Posted: Dec 18th, '15, 15:27
by mguzdial
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:
- mark-on-moon.png (107.1 KiB) Viewed 7117 times
Re: Chromakey
Posted: Jan 1st, '16, 13:06
by JohnM
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.
Re: Chromakey
Posted: Jan 9th, '16, 15:04
by mguzdial
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.