code: def stylize_cartoon(
      image,
      blur_ksize=3,
      segmentation_size=1.0,
      saturation=2.0,
      edge_prevalence=1.0,
      suppress_edges=True,
      from_colorspace=colorlib.CSPACE_RGB,
  ):
      """Convert the style of an image to a more cartoonish one.
  
      This function was primarily designed for images with a size of ``200``
      to ``800`` pixels. Smaller or larger images may cause issues.
  
      Note that the quality of the results can currently not compete with
      learned style transfer, let alone human-made images. A lack of detected
      edges or also too many detected edges are probably the most significant
      drawbacks.
  
      This method is loosely based on the one proposed in
      https://stackoverflow.com/a/11614479/3760780
  
      Added in 0.4.0.
  
      **Supported dtypes**:
  
          * ``uint8``: yes; fully tested
          * ``uint16``: no
          * ``uint32``: no
          * ``uint64``: no
          * ``int8``: no
          * ``int16``: no
          * ``int32``: no
          * ``int64``: no
          * ``float16``: no
          * ``float32``: no
          * ``float64``: no
          * ``float128``: no
          * ``bool``: no
  
      Parameters
      ----------
      image : ndarray
          A ``(H,W,3) uint8`` image array.
  
      blur_ksize : int, optional
          Kernel size of the median blur filter applied initially to the input
          image. Expected to be an odd value and ``>=0``. If an even value,
          thn automatically increased to an odd one. If ``<=1``, no blur will
          be applied.
  
      segmentation_size : float, optional
          Size multiplier to decrease/increase the base size of the initial
          mean-shift segmentation of the image. Expected to be ``>=0``.
          Note that the base size is increased by roughly a factor of two for
          images with height and/or width ``>=400``.
  
      edge_prevalence : float, optional
          Multiplier for the prevalance of edges. Higher values lead to more
          edges. Note that the default value of ``1.0`` is already fairly
          conservative, so there is limit effect from lowerin it further.
  
      saturation : float, optional
          Multiplier for the saturation. Set to ``1.0`` to not change the
          image's saturation.
  
      suppress_edges : bool, optional
          Whether to run edge suppression to remove blobs containing too many
          or too few edge pixels.
  
      from_colorspace : str, optional
          The source colorspace. Use one of ``imgaug.augmenters.color.CSPACE_*``.
          Defaults to ``RGB``.
  
      Returns
      -------
      ndarray
          Image in cartoonish style.
  
      """
      iadt.allow_only_uint8({image.dtype})
  
      assert (
          image.ndim == 3 and image.shape[2] == 3
      ), "Expected to get a (H,W,C) image, got shape %s." % (
          image.shape,
      )
  
      blur_ksize = max(int(np.round(blur_ksize)), 1)
      segmentation_size = max(segmentation_size, 0.0)
      saturation = max(saturation, 0.0)
  
      is_small_image = max(image.shape[0:2]) < 400
  
      image = _blur_median(image, blur_ksize)
      image_seg = np.zeros_like(image)
  
      if is_small_image:
          spatial_window_radius = int(10 * segmentation_size)
          color_window_radius = int(20 * segmentation_size)
      else:
          spatial_window_radius = int(15 * segmentation_size)
          color_window_radius = int(40 * segmentation_size)
  
      if segmentation_size <= 0:
          image_seg = image
      else:
          cv2.pyrMeanShiftFiltering(
              _normalize_cv2_input_arr_(image),
              sp=spatial_window_radius,
              sr=color_window_radius,
              dst=image_seg,
          )
  
      if is_small_image:
          edges_raw = _find_edges_canny(
              image_seg, edge_prevalence, from_colorspace
          )
      else:
          edges_raw = _find_edges_laplacian(
              image_seg, edge_prevalence, from_colorspace
          )
  
      edges = edges_raw
  
      edges = ((edges > 100) * 255).astype(np.uint8)
  
      if suppress_edges:
          # Suppress dense 3x3 blobs full of detected edges. They are visually
          # ugly.
          edges = _suppress_edge_blobs(edges, 3, 8, inverse=False)
  
          # Suppress spurious few-pixel edges (5x5 size with <=3 edge pixels).
          edges = _suppress_edge_blobs(edges, 5, 3, inverse=True)
  
      return _saturate(
          _blend_edges(image_seg, edges), saturation, from_colorspace
      )
  
imports: from __future__ import print_function, division, absolute_import
  import numpy
  import cv2
  from imgaug.imgaug import _normalize_cv2_input_arr_
  from .None import meta
  from .None import color
  from ..None import dtypes
  from ..None import parameters
label_desc: Use image node_id 1 for calling a global function with example usage: stylize_cartoon(image, blur_ksize, segmentation_size, saturation, edge_prevalence, suppress_edges, from_colorspace) and returns: _saturate