identify file type from magic bytes
resize images on canvas
compress JPEG and PNG on canvas
JPEG <-> PNG <-> WebP on canvas