Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with rendered canvas when using chromakey effect #167

Open
ghost opened this issue Jun 11, 2018 · 4 comments
Open

Issue with rendered canvas when using chromakey effect #167

ghost opened this issue Jun 11, 2018 · 4 comments

Comments

@ghost
Copy link

ghost commented Jun 11, 2018

I've been digging through the old questions on this trying to find a solution.

I did stumble upon this issue which recommended using reformat - example

But I'm struggling to get the rendered video to be 100% width / height whilst attempting this solution.

Below is my code.

var video;
var canvas;
var reformat;

function setup() {
  canvas = createCanvas(windowWidth, windowHeight, WEBGL);
  canvas.id('p5canvas');
  video = createCapture(VIDEO);
  video.size(620, 480);
  video.id('p5video');
  video.hide();

  reformat = createCanvas(windowWidth, windowHeight, WEBGL);
  reformat.id('reformat');

  var seriously = new Seriously();

  var src = seriously.source('#p5video');
  var target = seriously.target('#p5canvas');
  var reformat = seriously.transform("reformat");

  var chroma = seriously.effect('chroma');
  chroma.source = src;
  target.source = chroma;
  var r = 255 / 255;
  var g = 255 / 255;
  var b = 255 / 255;
  chroma.screen = [r,g,b,1];

  reformat.width = target.width;
  reformat.height = target.height;
  reformat.mode = 'cover';
  
  reformat.source = '#p5canvas';
  target.source = '#reformat';

  seriously.go();
}
@ghost
Copy link
Author

ghost commented Jun 11, 2018

I've also attempted targeting a canvas element in the DOM - but the rendered capture still seems to not fill the canvas element

@calleufuzi
Copy link

Hi! I had a same problem and with reformat solved my problem.

@calleufuzi
Copy link

calleufuzi commented Mar 30, 2020

try this

Captura de Tela 2020-03-30 às 02 43 14

try this! I hope this help you

@Headstock67
Copy link

@calleufuzi

Super job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants