Image manipulation, including trimming whitespace, resizing, and white-to-transparency conversion