code: function gamma (gamma, gammaOut) {
    if (!is.defined(gamma)) {
      // Default gamma correction of 2.2 (sRGB)
      this.options.gamma = 2.2;
    } else if (is.number(gamma) && is.inRange(gamma, 1, 3)) {
      this.options.gamma = gamma;
    } else {
      throw new Error('Invalid gamma correction (1.0 to 3.0) ' + gamma);
    }
    if (!is.defined(gammaOut)) {
      // Default gamma correction for output is same as input
      this.options.gammaOut = this.options.gamma;
    } else if (is.number(gammaOut) && is.inRange(gammaOut, 1, 3)) {
      this.options.gammaOut = gammaOut;
    } else {
      throw new Error('Invalid output gamma correction (1.0 to 3.0) ' + gammaOut);
    }
    return this;
  }
docs: Apply a gamma correction by reducing the encoding (darken) pre-resize at a factor of `1/gamma`
  then increasing the encoding (brighten) post-resize at a factor of `gamma`.
  This can improve the perceived brightness of a resized image in non-linear colour spaces.
  JPEG and WebP input images will not take advantage of the shrink-on-load performance optimisation
  when applying a gamma correction.
  
  Supply a second argument to use a different output gamma value, otherwise the first value is used in both cases.
  
  @param {Number} [gamma=2.2] value between 1.0 and 3.0.
  @param {Number} [gammaOut] value between 1.0 and 3.0. (optional, defaults to same as `gamma`)
  @returns {Sharp}
  @throws {Error} Invalid parameters