How to apply a vhs effect?

Does anyone have an idea how to apply this vhs effect in a PImage?

Hi molo32,

Can you bit a bit more precise? Are you speaking about the right and left edge of the video, the noise in the dark area, the white surrounding objects, the white particules running through the screen, all of the above, something else?

You need to break down your project so it can be handled.

Some ideas for the different points listed:

  • For the edge of the video. Create a PShape, add some vertex to make a rectangle that you fill in a browny color and play with the noise function to break the edges of that rectangle over time. You can also play with there position a bit.
  • For the noise in the dark area, you can use the noise function to create a greyscale image (you would need to tweek it a bit and to probably do something more complex than just a noise map to look like the noise you see on the video). Then use a blend mode to blend it only in the dark area of the image.
  • The white surrounding objects might be the more challenging. You would need to use an edge detection algorithm (I think a high pass filter should do the trick) but you might also get edge inside objects. On the video it is only the outside edges that are used.
  • For the white particules, you should create a particule class. Every time you create a new one, you give it a random shape (so you’ll need a shape generator) and a speed and a direction. Some noise that deform it over time could be cool effect too.

Hope it helps at least a bit :slight_smile:

2 Likes

I found this link to using glsl filters that might be interesting to you from https://github.com/SableRaf/Shadertoy2Processing.

2 Likes

Also on the GLSL front check out https://www.interactiveshaderformat.com/ Search VHS and you’ll find quite a few. Not sure if anyone has posted on converting ISF shaders to work in Processing, or if there’s a converter, but it’s not too difficult.

ISF is more aimed at video processing, VJing, etc. so can be a useful resource for this sort of thing.

As some have noted, this isn’t really one effect – this is a large collection of effects, each of which simulates a different aspect of the way magnetic tape degrades – problems with scratches, feed alignment, playback speed, and then the limitations of the color signal that can be stored and the way that it degrades on the tape over multiple playbacks / over time.

Each of this might be fun to write as a separate little function. For example:

void roughEdges(PImage img){
  // randomly darken little strips of pixels on the left and right side
}

void scratches(PImage img) {
  // randomly add short horizontal streaks of white that tail off to the right
}

Et cetera.

While shaders are probably the way to go for high performance, if you are not familiar with PShader and GLSL filters then don’t be afraid to prototype your experiments with pixel manipulation in straight Processing and then convert your prototypes into shaders (which are another language) once you are happy with them.

1 Like