#N canvas 207 93 659 563 10;
#X declare -lib Gem;
#X text 442 8 GEM object;
#X obj 8 328 cnv 15 430 210 empty empty empty 20 12 0 14 #e0e0e0 #404040 0;
#X text 39 328 Inlets:;
#X text 42 502 Outlets:;
#X obj 8 292 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0;
#X text 17 291 Arguments:;
#X obj 8 56 cnv 15 430 230 empty empty empty 20 12 0 14 #e0e0e0 #404040 0;
#X obj 449 77 cnv 15 195 345 empty empty empty 20 12 0 14 #dce4fc #404040 0;
#X text 453 60 Example:;
#X obj 518 430 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0;
#X obj 451 185 cnv 15 160 175 empty empty empty 20 12 0 14 #14e814 #404040 0;
#X obj 451 119 gemhead;
#X obj 496 101 bng 15 250 50 0 empty empty pix_load 20 8 0 8 #fcfcfc #000000 #000000;
#X text 63 302 <none>;
#X text 18 516 Outlet 1: gemlist;
#X text 15 342 Inlet 1: gemlist;
#X obj 580 120 gemhead;
#X obj 625 102 bng 15 250 50 0 empty empty empty 20 8 0 8 #fcfcfc #000000 #000000;
#X text 16 483 Inlet 2: gemlist;
#X text 71 31 Class: pix mix object;
#X text 50 12 Synopsis: [pix_chroma_key];
#X text 29 57 Description: mix 2 images based on their color;
#X obj 451 338 pix_chroma_key;
#X msg 486 315 direction \$1;
#X obj 486 295 tgl 15 1 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1;
#X text 16 441 Inlet 1: direction 0|1 : which stream is the key-source (0=left stream \; 1 = right stream);
#X floatatom 465 203 5 0 255 0 - - - 0;
#X floatatom 475 255 5 0 255 0 - - - 0;
#X text 15 197 The 2 images have to be of the same size.;
#X text 14 76 [pix_chroma_key] does compositing using pixel by pixel comparisons on two video streams. the comparison is based on user a user supplied RGB or YUV pixel value and +/- range. if the pixel in the key source lies within the range \, then it is replaced by the corresponding pixel im the other stream. typically this is most effective on a static background like a green/blue screen \, but can be effective when used with other GEM objects like pix_background for live video processing.;
#X text 15 357 Inlet 1: value <list> : list of 3 floats of the pixel-value to key out: values are either Red/Green/Blue (in RGBA-Space) or Y(luma)/U(Cb)/V(Cr) in YUV-Space;
#X text 16 397 Inlet 1: range <list> : list of 3 floats defining the +/-range of the key: values are either Red/Green/Blue (in RGBA-Space) or Y(luma)/U(Cb)/V(Cr) in YUV-Space;
#X obj 478 241 hsl 128 12 0 1 0 0 empty empty empty -2 -8 0 10 #fcfcfc #000000 #000000 0 1;
#X obj 468 188 hsl 128 12 0 1 0 0 empty empty empty -2 -8 0 10 #fcfcfc #000000 #000000 0 1;
#X msg 465 220 value \$1 \$1 \$1;
#X msg 475 273 range \$1 \$1 \$1;
#N canvas 0 22 587 366 image 0;
#X obj 77 48 inlet;
#X obj 77 344 outlet;
#X obj 223 55 inlet;
#X msg 223 123 open \$1;
#X obj 223 100 openpanel;
#X obj 77 212 pix_yuv;
#X text 133 214 we really want YUV;
#X obj 77 174 pix_image examples/data/dancer.JPG;
#X connect 0 0 7 0;
#X connect 2 0 4 0;
#X connect 3 0 7 0;
#X connect 4 0 3 0;
#X connect 5 0 1 0;
#X connect 7 0 5 0;
#X restore 451 138 pd image;
#X text 449 77 open two different images;
#N canvas 0 22 587 366 image 0;
#X obj 77 28 inlet;
#X obj 77 344 outlet;
#X obj 223 35 inlet;
#X msg 223 103 open \$1;
#X obj 223 80 openpanel;
#X obj 77 301 pix_buf;
#X msg 103 277 auto 1;
#X obj 103 256 loadbang;
#X text 166 263 [pix_buf] with auto 1 is important if we want to recalculate our pix-effect each frame but don't want to reload the image all the time.;
#X obj 77 230 pix_yuv;
#X obj 77 185 pix_image examples/data/fractal.JPG;
#X connect 0 0 10 0;
#X connect 2 0 4 0;
#X connect 3 0 10 0;
#X connect 4 0 3 0;
#X connect 5 0 1 0;
#X connect 6 0 5 0;
#X connect 7 0 6 0;
#X connect 9 0 5 0;
#X connect 10 0 9 0;
#X restore 580 139 pd image;
#N canvas 484 243 450 300 META 0;
#X obj 10 25 declare -lib Gem;
#X text 10 45 DESCRIPTION mix 2 images based on their color;
#X text 10 65 KEYWORDS Gem pix image;
#X text 20 85 INLET_0 gemlist value range direction;
#X text 20 105 INLET_1 gemlist;
#X text 20 125 OUTLET_0 gemlist;
#X text 10 145 AUTHOR IOhannes m zmölnig;
#X text 10 165 LICENSE GPL v2;
#X restore 508 8 pd META;
#X obj 451 161 pix_rgba;
#X obj 580 162 pix_rgba;
#X text 511 155 or [pix_yuv], f 9;
#X text 15 215 RGB values are 0-1 \, YUV values are 16/255-239/255. It is strongly advised to convert explicitly to your preferred colorspace before [pix_chroma_key] because the default colorspace is not guaranteed to be the same across operating systems (see [pix_rgba] or [pix_yuv]).;
#X obj 451 370 _pix2rectangle 3;
#X obj 526 436 _gemwin;
#X connect 11 0 36 0;
#X connect 12 0 36 1;
#X connect 16 0 38 0;
#X connect 17 0 38 1;
#X connect 22 0 44 0;
#X connect 23 0 22 0;
#X connect 24 0 23 0;
#X connect 26 0 34 0;
#X connect 27 0 35 0;
#X connect 32 0 27 0;
#X connect 33 0 26 0;
#X connect 34 0 22 0;
#X connect 35 0 22 0;
#X connect 36 0 40 0;
#X connect 38 0 41 0;
#X connect 40 0 22 0;
#X connect 41 0 22 1;
