bytesPerPixel() {
    if (this._bitDepth < 8) {
      throw new Error('Bit depths below 8 bit are currently not supported.');
    }

    const byteDepth = this._bitDepth / 8;
    if (this._colorType === 0) {
      return byteDepth;
    }
    if (this._colorType === 2) {
      return 3 * byteDepth;
    }
    if (this._colorType === 3) {
      return byteDepth;
    }
    if (this._colorType === 4) {
      return 2 * byteDepth;
    }

    return 4 * byteDepth;
  }
Returns the number of bytes to read per pixel.

@return {number}