function heif (options) {
  if (is.object(options)) {
    if (is.defined(options.quality)) {
      if (is.integer(options.quality) && is.inRange(options.quality, 1, 100)) {
        this.options.heifQuality = options.quality;
      } else {
        throw is.invalidParameterError('quality', 'integer between 1 and 100', options.quality);
      }
    }
    if (is.defined(options.lossless)) {
      if (is.bool(options.lossless)) {
        this.options.heifLossless = options.lossless;
      } else {
        throw is.invalidParameterError('lossless', 'boolean', options.lossless);
      }
    }
    if (is.defined(options.compression)) {
      if (is.string(options.compression) && is.inArray(options.compression, ['av1', 'hevc'])) {
        this.options.heifCompression = options.compression;
      } else {
        throw is.invalidParameterError('compression', 'one of: av1, hevc', options.compression);
      }
    }
    if (is.defined(options.effort)) {
      if (is.integer(options.effort) && is.inRange(options.effort, 0, 9)) {
        this.options.heifEffort = options.effort;
      } else {
        throw is.invalidParameterError('effort', 'integer between 0 and 9', options.effort);
      }
    } else if (is.defined(options.speed)) {
      if (is.integer(options.speed) && is.inRange(options.speed, 0, 9)) {
        this.options.heifEffort = 9 - options.speed;
      } else {
        throw is.invalidParameterError('speed', 'integer between 0 and 9', options.speed);
      }
    }
    if (is.defined(options.chromaSubsampling)) {
      if (is.string(options.chromaSubsampling) && is.inArray(options.chromaSubsampling, ['4:2:0', '4:4:4'])) {
        this.options.heifChromaSubsampling = options.chromaSubsampling;
      } else {
        throw is.invalidParameterError('chromaSubsampling', 'one of: 4:2:0, 4:4:4', options.chromaSubsampling);
      }
    }
  }
  return this._updateFormatOut('heif', options);
}
/**
 * Use these HEIF options for output image.
 *
 * Support for patent-encumbered HEIC images requires the use of a
 * globally-installed libvips compiled with support for libheif, libde265 and x265.
 *
 * @since 0.23.0
 *
 * @param {Object} [options] - output options
 * @param {number} [options.quality=50] - quality, integer 1-100
 * @param {string} [options.compression='av1'] - compression format: av1, hevc
 * @param {boolean} [options.lossless=false] - use lossless compression
 * @param {number} [options.effort=4] - CPU effort, between 0 (fastest) and 9 (slowest)
 * @param {string} [options.chromaSubsampling='4:4:4'] - set to '4:2:0' to use chroma subsampling
 * @returns {Sharp}
 * @throws {Error} Invalid options
 */
Use these HEIF options for output image.
Support for patent-encumbered HEIC images requires the use of a
globally-installed libvips compiled with support for libheif, libde265 and x265.




Use these HEIF options for output image . Support for patent - encumbered HEIC images requires the use of a globally - installed libvips compiled with support for libheif libde265 and x265 .
function heif (options) {
  if (is.object(options)) {
    if (is.defined(options.quality)) {
      if (is.integer(options.quality) && is.inRange(options.quality, 1, 100)) {
        this.options.heifQuality = options.quality;
      } else {
        throw is.invalidParameterError('quality', 'integer between 1 and 100', options.quality);
      }
    }
    if (is.defined(options.lossless)) {
      if (is.bool(options.lossless)) {
        this.options.heifLossless = options.lossless;
      } else {
        throw is.invalidParameterError('lossless', 'boolean', options.lossless);
      }
    }
    if (is.defined(options.compression)) {
      if (is.string(options.compression) && is.inArray(options.compression, ['av1', 'hevc'])) {
        this.options.heifCompression = options.compression;
      } else {
        throw is.invalidParameterError('compression', 'one of: av1, hevc', options.compression);
      }
    }
    if (is.defined(options.effort)) {
      if (is.integer(options.effort) && is.inRange(options.effort, 0, 9)) {
        this.options.heifEffort = options.effort;
      } else {
        throw is.invalidParameterError('effort', 'integer between 0 and 9', options.effort);
      }
    } else if (is.defined(options.speed)) {
      if (is.integer(options.speed) && is.inRange(options.speed, 0, 9)) {
        this.options.heifEffort = 9 - options.speed;
      } else {
        throw is.invalidParameterError('speed', 'integer between 0 and 9', options.speed);
      }
    }
    if (is.defined(options.chromaSubsampling)) {
      if (is.string(options.chromaSubsampling) && is.inArray(options.chromaSubsampling, ['4:2:0', '4:4:4'])) {
        this.options.heifChromaSubsampling = options.chromaSubsampling;
      } else {
        throw is.invalidParameterError('chromaSubsampling', 'one of: 4:2:0, 4:4:4', options.chromaSubsampling);
      }
    }
  }
  return this._updateFormatOut('heif', options);
}
function heif ( options ) { if ( is . object ( options ) ) { if ( is . defined ( options . quality ) ) { if ( is . integer ( options . quality ) && is . inRange ( options . quality , 1 , 100 ) ) { this . options . heifQuality = options . quality ; } else { throw is . invalidParameterError ( 'quality' , 'integer between 1 and 100' , options . quality ) ; } } if ( is . defined ( options . lossless ) ) { if ( is . bool ( options . lossless ) ) { this . options . heifLossless = options . lossless ; } else { throw is . invalidParameterError ( 'lossless' , 'boolean' , options . lossless ) ; } } if ( is . defined ( options . compression ) ) { if ( is . string ( options . compression ) && is . inArray ( options . compression , [ 'av1' , 'hevc' ] ) ) { this . options . heifCompression = options . compression ; } else { throw is . invalidParameterError ( 'compression' , 'one of: av1, hevc' , options . compression ) ; } } if ( is . defined ( options . effort ) ) { if ( is . integer ( options . effort ) && is . inRange ( options . effort , 0 , 9 ) ) { this . options . heifEffort = options . effort ; } else { throw is . invalidParameterError ( 'effort' , 'integer between 0 and 9' , options . effort ) ; } } else if ( is . defined ( options . speed ) ) { if ( is . integer ( options . speed ) && is . inRange ( options . speed , 0 , 9 ) ) { this . options . heifEffort = 9 - options . speed ; } else { throw is . invalidParameterError ( 'speed' , 'integer between 0 and 9' , options . speed ) ; } } if ( is . defined ( options . chromaSubsampling ) ) { if ( is . string ( options . chromaSubsampling ) && is . inArray ( options . chromaSubsampling , [ '4:2:0' , '4:4:4' ] ) ) { this . options . heifChromaSubsampling = options . chromaSubsampling ; } else { throw is . invalidParameterError ( 'chromaSubsampling' , 'one of: 4:2:0, 4:4:4' , options . chromaSubsampling ) ; } } } return this . _updateFormatOut ( 'heif' , options ) ; }
Use these HEIF options for output image.
Use these HEIF options for output image .