If your input is an image it is a binary file you need the output format to be "a single buffer object"