# Framerate in live video delay project : Ed Tannenbaum, Recollections

**URL:** <https://discourse.processing.org/t/framerate-in-live-video-delay-project-ed-tannenbaum-recollections/3129>\
**Category:** Project Guidance\
**Created:** [August 31, 2018, 10:44am UTC](https://discourse.processing.org/t/framerate-in-live-video-delay-project-ed-tannenbaum-recollections/3129 "2018-08-31T10:44:38Z")\
**Posts on this page:** 1\
**Showing post:** 28

<div class="post-metadata">

**Author:** ![jb4x](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jb4x/32/789_2.png) [@jb4x](https://discourse.processing.org/u/jb4x)\
**Post date:** [September 1, 2018, 4:39pm UTC](https://discourse.processing.org/t/framerate-in-live-video-delay-project-ed-tannenbaum-recollections/3129/28 "2018-09-01T16:39:54Z")

</div>

You are still computing the `int()` operation and the `modulus` one for every pixel of the image.

Again, I really don’t know if this can be it, I’m not qualified enough to be sure about the performance of those functions. Someone more capable can surely tell us if it can be that.

Edit:

You can try something like this.  
You create an array with 256 values let’s call it `brightToCol`.  
Since you have 8 different colors you would fill it in like this:

```auto
brightToCol[0] = 0;
brightToCol[1] = 1;
...
brightToCol[6] = 6;
brightToCol[7] = 0;
brightToCol[8] = 1;
...

```

Then you can get your color with this line:

```auto
color cc=colors2[brightToCol[b]];

```

Is this better? Specially combined with @GoToLoop optimization.

---

_[View the full topic](https://discourse.processing.org/t/framerate-in-live-video-delay-project-ed-tannenbaum-recollections/3129)._
