Implement clip to document as image post processing

This is ready to go, and is required by https://github.com/adobe-photoshop/generator-assets/pull/315

This adds the options to calculate the area to extract if you want to clip to the document bounds (or any clipTo bounds you want to use)
I don't really understand why this is called `getExtract`. That name doesn't (to me) explain what this function does.