First of all check if your image host supports an API, the better ones like imageshack and imgur do allow it.

Just follow the docs to upload your image, chances are you'll need to learn CURL as well.