function withIccProfile (icc, options) {
  if (is.string(icc)) {
    this.options.withIccProfile = icc;
  } else {
    throw is.invalidParameterError('icc', 'string', icc);
  }
  this.keepIccProfile();
  if (is.object(options)) {
    if (is.defined(options.attach)) {
      if (is.bool(options.attach)) {
        if (!options.attach) {
          this.options.keepMetadata &= ~0b01000;
        }
      } else {
        throw is.invalidParameterError('attach', 'boolean', options.attach);
      }
    }
  }
  return this;
}
Transform using an ICC profile and attach to the output image.

This can either be an absolute filesystem path or
built-in profile name (`srgb`, `p3`, `cmyk`).

@since 0.33.0

@example
const outputWithP3 = await sharp(input)
  .withIccProfile('p3')
  .toBuffer();

@param {string} icc - Absolute filesystem path to output ICC profile or built-in profile name (srgb, p3, cmyk).
@param {Object} [options]
@param {number} [options.attach=true] Should the ICC profile be included in the output image metadata?
@returns {Sharp}
@throws {Error} Invalid parameters