Right now I use an old copy of photoshop that a friend burned for me (7 I think), but I really don't like using an illegal copy. I'd rather buy my own, but its very expensive. So I was hoping for some advice on possible free paint/art programs.

Some features of photoshop are really vital though. It has to have the option of layers. I wouldn't be able to function without layers. Being able to lock pixels is important too. Other functions I would really have trouble without are dodge and burn tools, the smudge tool, gradient and solid color fill, the lasso or magic wand tool, and adjusting brightness/contrast. Then of course the basics, eraser, pencil, paintbrush with varying sizes etc.

Are there any free digital art/painting programs that have most if not all of these features?