My old JS Raytracer
There is a version of this somewhere around that is exactly 5,120 bytes; this is a shade over. Why I can't recall now, but it was probably to add in a couple more items to the scene.
It's not a great piece of code (I was 13...) and has some horrible things like eval()'s in there, but it works. I really should re-write it one of these days. I wonder how fast it could be made via asm.js....
Incidentally, on appropriate browsers it will actually output a bitmap (or, otherwise, use a horrible kludge to output an 'image', ah, the good old days...)