code: private static Bitmap.CompressFormat getOutputFormat(@Nullable final ImageFormat format) {
      if (format == null) {
        return Bitmap.CompressFormat.JPEG;
      }
  
      if (format == DefaultImageFormats.JPEG) {
        return Bitmap.CompressFormat.JPEG;
      } else if (format == DefaultImageFormats.PNG) {
        return Bitmap.CompressFormat.PNG;
      } else {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH
            && DefaultImageFormats.isStaticWebpFormat(format)) {
          return Bitmap.CompressFormat.WEBP;
        }
  
        return Bitmap.CompressFormat.JPEG;
      }
    }
docs: Determine the {@link Bitmap.CompressFormat} given the {@link ImageFormat}. If no match is
  found, it returns {@link Bitmap.CompressFormat#JPEG}
  
  @param format The {@link ImageFormat} used as input
  @return The corresponding {@link Bitmap.CompressFormat}