Photoshop...after you're done editing you press ctrl+A to select all

Edit>stroke

then tell it how big of a border you want..usually about 10-15-20 px is good enough and make sure you change it to black.