Agree with Maciej Los. Use Google for easy things, by that way you could save your time(ours too).
Use
GIMP[
^]. As a great alternative for Photoshop, you could use GIMP for slice images.
There's a GIMP plugin for your requirement, check it out.
Script to Convert PSD Files to HTML Templates[
^]