encode
async encode(file)
File should be { type, data } where type is `png`, `webp`, or `jpg`, etc.