Chromakey

Post your nifty GP projects here!

Moderator: MSandro

Post Reply
mguzdial
Posts: 70
Joined: Sep 15th, '15, 11:21

Chromakey

Post by mguzdial » Dec 18th, '15, 15:27

Now I can do Chromakey in GP!

Here's the source image, me (a long time ago) in front of a blue background:
blue-mark.png
Here's the moon background source:
moon.png
Here's the script that walks through the pixels and swaps in the moon for a very blue pixel:
chromakey.png
And here's the result:
mark-on-moon.png
mark-on-moon.png (107.1 KiB) Viewed 4208 times
Attachments
pixelsMorev2.gp
(3.74 KiB) Downloaded 119 times
chromakey.gpp
(1.15 MiB) Downloaded 74 times

JohnM
Posts: 379
Joined: Sep 11th, '15, 14:42

Re: Chromakey

Post by JohnM » Jan 1st, '16, 13:06

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.

mguzdial
Posts: 70
Joined: Sep 15th, '15, 11:21

Re: Chromakey

Post by mguzdial » Jan 9th, '16, 15:04

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.

Post Reply