code: def process_rgb_bytes(bytes_in, width, height, quality=DEFAULT_JPEG_QUALITY):
      
      if len(bytes_in) != width * height * 3:
          raise ValueError("bytes_in length is not coherent with given width and height")  # noqa
  
      bytes_out_p = ffi.new("char**")
      bytes_out_p_gc = ffi.gc(bytes_out_p, lib.guetzli_free_bytes)
  
      length = lib.guetzli_process_rgb_bytes(
              bytes_in,
              width,
              height,
              bytes_out_p_gc,
              quality
              )
  
      bytes_out = ffi.cast("char*", bytes_out_p_gc[0])
      return ffi.unpack(bytes_out, length)
docs: Generates an optimized JPEG from RGB bytes.
  
      :param bytes bytes_in: the input image's bytes
      :param int width: the width of the input image
      :param int height: the height of the input image
      :param int quality: the output JPEG quality (default 95)
  
      :returns: Optimized JPEG bytes
      :rtype: bytes
  
      :raises ValueError: the given width and height is not coherent with the
                          ``bytes_in`` length.
  
      .. code:: python
  
          import pyguetzli
  
          # 2x2px RGB image
          #                |    red    |   green   |
          image_pixels  = b"\\xFF\\x00\\x00\\x00\\xFF\\x00"
          image_pixels += b"\\x00\\x00\\xFF\\xFF\\xFF\\xFF"
          #                |   blue    |   white   |
  
          optimized_jpeg = pyguetzli.process_rgb_bytes(image_pixels, 2, 2)