I see way too many badly done muzzle flash effects on YouTube to not want to do this basic Visual Effects 101 tutorial.
It is really not hard to add a few layers onto your scene to create great looking gun fire. And this video will show you how :)

How to Make Realistic Looking Gun Fire (Muzzle Flash) Effects – Visual Effects 101

Compositing the layers for a realistic muzzle flash

To create this effect, you will have to composite a number of layers. Of course, these are not hard set rules so experiment if something doesn’t seem to fit right – to me, that is always the most fun part anyways :)

The first thing I add is the actual muzzle flash effect. I really love the Action Esssentials 2 package from VideoCopilot and for $99 for the 720p version, I highly recommend it. It’s filled with pre keyed stock footage and I use it almost daily. However, you can also find free action stock footage just by searching on google :)
Here’s a useful link to free stock footage from detonation films.

Anyways, take and position a muzzle flash element on top of your base footage.

Next, add another solid colour layer to simulate the light emitting from the muzzle flash. Set it to a colour that is very similar to the muzzle flash and change the blend mode to additive. I usually set the opacity to around 20.

Just putting a solid layer over everything does look pretty crappy. If there was a real muzzle flash in the scene, only the elements facing the front of the gun would be lit. We can simulate this by applying some masks and cutting out only the areas that would directly be hit by the light.

Once you’re done, your shot should look something like this:

It’s not bad, but I personally find that using a simple overlay layer to simulate the muzzle flash light sits very unnaturally on top of our footage rather than in the scene. We can make this look a lot more natural with a technique I described in my After Effects – Natural Lighting VFX Using Mattes tutorial: by creating a matte layer.