# How to apply a vhs effect?

**URL:** <https://discourse.processing.org/t/how-to-apply-a-vhs-effect/3268>\
**Category:** Project Guidance\
**Created:** [September 5, 2018, 4:57am UTC](https://discourse.processing.org/t/how-to-apply-a-vhs-effect/3268 "2018-09-05T04:57:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![molo32](https://avatars.discourse-cdn.com/v4/letter/m/a87d85/32.png) [@molo32](https://discourse.processing.org/u/molo32)\
**Post date:** [September 5, 2018, 4:57am UTC](https://discourse.processing.org/t/how-to-apply-a-vhs-effect/3268/1 "2018-09-05T04:57:36Z")

</div>

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

[![](https://img.youtube.com/vi/osUvH8PRk3g/hqdefault.jpg "AVISynth: Realistic VHS Effect! (NEW: Horizontal Jitter!) (Mar 3, 13) [+Short Tutorial!]") ](https://www.youtube.com/watch?v=osUvH8PRk3g)

---

<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 5, 2018, 5:45am UTC](https://discourse.processing.org/t/how-to-apply-a-vhs-effect/3268/2 "2018-09-05T05:45:00Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![monkstone](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/monkstone/32/64_2.png) [@monkstone](https://discourse.processing.org/u/monkstone)\
**Post date:** [September 5, 2018, 6:23am UTC](https://discourse.processing.org/t/how-to-apply-a-vhs-effect/3268/3 "2018-09-05T06:23:55Z")

</div>

I found this [link to using glsl filters](https://github.com/georgehenryrowe/ShadersForProcessing3) that might be interesting to you from [https://github.com/SableRaf/Shadertoy2Processing](https://github.com/SableRaf/Shadertoy2Processing).

---

<div class="post-metadata">

**Author:** ![neilcsmith](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/neilcsmith/32/144_2.png) [@neilcsmith](https://discourse.processing.org/u/neilcsmith)\
**Post date:** [September 5, 2018, 8:08am UTC](https://discourse.processing.org/t/how-to-apply-a-vhs-effect/3268/4 "2018-09-05T08:08:41Z")

</div>

Also on the GLSL front check out [https://www.interactiveshaderformat.com/](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.

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [September 7, 2018, 4:12pm UTC](https://discourse.processing.org/t/how-to-apply-a-vhs-effect/3268/5 "2018-09-07T16:12:39Z")

</div>

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:

```auto
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.

 ![36%20AM](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/d/dd0e12a470dd2d73a62571d847e45d01f2528f86.png)
