How to generate a heat map of areas where players die?

I need to use a list of Vector3 values of positions of where on a map players die to create a smooth heat map that is different colors to represent the densities of deaths in all areas of the map. I need it to then be made into a jpeg. Any suggestions?

How about this?

I’m guessing that, since you want a jpeg, it will be an overhead view of the map. If so, you can drop the vectors’ Y component. Create a 2D byte array that will hold the pixels of your heat map image, and zero it out.

Then figure out how you want to map your world vector (x,y) to byte array (x,y). For example, maybe each 1.0 unit in world space is equivalent to 1 pixel. Then just add 1 (or whatever factor) to the pixel (x,y), clamping it at 255. To smooth the map, you could add 2 to the pixel (x,y) and 1 to all the neighboring pixels.

Once you have your image in a byte array, use these .NET 3.5 instructions to encode to JPEG: