Flickering saturation

Hi, little bit of a strange one!

So I’m trying to code into a programme a saturation slider. This works, however the saturation seems to flicker on and off in the draw function, as if it gets drawn as the original colour of the video, then gets changed, and so on… but it is not fast enough not to notice the change

This is my code if it helps at all

if (SAT == true){
 myMovie.loadPixels();
for(int i = 0; i < myMovie.pixels.length; i++){
  colorMode(HSB);
  satLevel=0;
h=hue(myMovie.pixels[i]);
 ss=saturation(myMovie.pixels[i]);
bb=brightness(myMovie.pixels[i]);
myMovie.pixels[i] = color(h,ss*satLevel,bb); 
}

}
myMovie.updatePixels();
colorMode(RGB);

Thank you for the help

1 Like

Were you able to resolve this issue? It is difficulty to see what is going wrong without a short runnable example (an MCVE).

For starters, it looks like you are calling myMovie.loadPixels() inside an if, and calling myMovie.updatePixels() outside it. You are also calling colorMode(HSB) hundreds of times instead of once. There may be other things that are relevant – but tough to say what is going on with just this snippet.

Hi Jeremy thanks for the reply. I wasn’t able to find a solution, thanks for your suggestion they’re completely right, do you know what I need to do to call it only once? So that it’s not reading the saturation of the pixels then continuously multiplying them by satLevel?