code: def mandelbrot_capture(x, y, w, h, params):
      
  
      # FIXME: Figure out why these corrections are necessary or how to make them perfect
      # Viewport is offset compared to window when capturing without these (found empirically)
      if params.plane_ratio >= 1.0:
          x -= params.plane_w
      else:
          x += 3.0 * params.plane_w
  
      ratio = w / h
      n_x = x * 2.0 / w * ratio - 1.0
      n_y = y * 2.0 / h - 1.0
      mb_x = params.zoom * n_x + params.mb_cx
      mb_y = params.zoom * n_y + params.mb_cy
  
      mb = mandelbrot_iterate(mb_x + 1j * mb_y, params.max_iterations, params.julia_seed)
      z, iterations = mb
  
      # Continuous iteration count for no banding
      # https://en.wikipedia.org/wiki/Mandelbrot_set#Continuous_.28smooth.29_coloring
      nu = params.max_iterations
      if iterations < params.max_iterations:
          nu = iterations + 2 - abs(cmath.log(cmath.log(abs(z)) / cmath.log(params.max_iterations), 2))
  
      return clamp(nu, 0, params.max_iterations)
docs: Computes the number of iterations of the given pixel-space coordinates,
      for high-res capture purposes.
  
      Contrary to :func:`mandelbrot`, this function returns a continuous
      number of iterations to avoid banding.
  
      :param x: X coordinate on the picture
      :param y: Y coordinate on the picture
      :param w: Width of the picture
      :param h: Height of the picture
      :param params: Current application parameters.
      :type params: params.Params
      :return: Continuous number of iterations.