this can be useful to convert images before writing them out in a specific format.
input
output
channels
format