The picture is not of sufficient quality to be of value. Unless you have seen these gnats flying off your head I would not believe they are gnats. They are probably hook worm. Dead hook worm are black and they appear black when coming out of the skin. They are even in rice.
They are everywhere and most people have them and don't know it. You could kill them on your head but they are through out your system now. You will need to use meds like fenbendazole. This simple parasite seems to be the hardest one to eradicate. I don't want to offend the Alt Med people but you should go to the parasites RX forum and just start reading everything. Make the assumption they are hook worms because you won't find a thing on gnats.
Gnats do not infect the body as they are flies. They lay eggs on food sources to feed their larvae. They need air to develop. If you are seeing gnats flying make sure they are actually there and not in your eye swimming by your cornea. (It happened to me.)
I also had hook worm in my scalp and was constantly feeling little bumps.
In the interim try a head lice treatment for the scalp problem. The drug should work partially for gnats or hook worm. Temporary relief until you can do the appropriate drug research to solve your problem.