you don't say which platform.... if you are running mac os x with photoshop in classic, you can create an applescript that will be able to run just about any photoshop command sequence you want. you can then call the applescript from php with exec or popen or whatever.
if you're running windows your sol.