code: def brightness(img, stateimg, factor, offset):
      """Modify the brightness of an image.
      'factor' is multiplied to all channels, which are
      then added by 'amount'. Overflow is clipped.
  
      Parameters
      ----------
      img : (M, N, 3) ndarray of uint8
          Output image.
      stateimg : (M, N, 3) ndarray of uint8
          Input image.
      factor : float
          Multiplication factor.
      offset : int
          Ammount to add to each channel.
  
      """
  
      height, width, _ = img.shape
  
      lut = [np.uint8()] * 256
  
      for k in range(256):
          op_result = k * factor + offset
          if op_result > 255:
              op_result = 255
          elif op_result < 0:
              op_result = 0
  
          lut[k] = np.uint8(op_result)
  
      for i in range(height):
          for j in range(width):
              img[i, j, 0] = lut[stateimg[i, j, 0]]
              img[i, j, 1] = lut[stateimg[i, j, 1]]
              img[i, j, 2] = lut[stateimg[i, j, 2]]
  
file_path: pythran/pythran/tests/scikit-image/_colormixer.py
imports: import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: brightness(img, stateimg, factor, offset) without return types