class_docstr: The renderer handles all the drawing primitives using a graphics
  context instance that controls the colors/styles
docstr: Save the plot in the current canvas as a image and apply
  the *post_processing* function.
  
     def post_processing(image, dpi):
       # ny, nx, depth = image.shape
       # image (numpy array) has RGBA channels and has a depth of 4.
       ...
       # create a new_image (numpy array of 4 channels, size can be
       # different). The resulting image may have offsets from
       # lower-left corner of the original image
       return new_image, offset_x, offset_y
  
  The saved renderer is restored and the returned image from
  post_processing is plotted (using draw_image) on it.
docstr_tok: ["Save","the","plot","in","the","current","canvas","as","a","image","and","apply","the","*","post_processing","*","function",".","def","post_processing","(","image",",","dpi",")",":","#","ny",",","nx",",","depth","=","image.shape","#","image","(","numpy","array",")","has","RGBA","channels","and","has","a","depth","of","4",".","...","#","create","a","new_image","(","numpy","array","of","4","channels",",","size","can","be","#","different",")",".","The","resulting","image","may","have","offsets","from","#","lower-left","corner","of","the","original","image","return","new_image",",","offset_x",",","offset_y","The","saved","renderer","is","restored","and","the","returned","image","from","post_processing","is","plotted","(","using","draw_image",")","on","it","."]
code: def stop_filter(self, post_processing):
      """
      Save the plot in the current canvas as a image and apply
      the *post_processing* function.
  
         def post_processing(image, dpi):
           # ny, nx, depth = image.shape
           # image (numpy array) has RGBA channels and has a depth of 4.
           ...
           # create a new_image (numpy array of 4 channels, size can be
           # different). The resulting image may have offsets from
           # lower-left corner of the original image
           return new_image, offset_x, offset_y
  
      The saved renderer is restored and the returned image from
      post_processing is plotted (using draw_image) on it.
      """
  
      # WARNING:  For agg_filter to work, the renderer's method need to
      # overridden in the class. See draw_markers and draw_path_collections.
  
      width, height = int(self.width), int(self.height)
  
      buffer, bounds = self.tostring_rgba_minimized()
  
      l, b, w, h = bounds
  
      self._renderer = self._filter_renderers.pop()
      self._update_methods()
  
      if w > 0 and h > 0:
          img = np.frombuffer(buffer, np.uint8)
          img, ox, oy = post_processing(
              img.reshape((h, w, 4)) / 255.0, self.dpi
          )
          gc = self.new_gc()
          if img.dtype.kind == "f":
              img = np.asarray(img * 255.0, np.uint8)
          img = img[::-1]
          self._renderer.draw_image(
              gc, l + ox, height - b - h + oy, img
          )
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import six
  import numpy
  from collections import OrderedDict
  from math import radians, cos, sin
  from matplotlib import cbook, rcParams, __version__
  from matplotlib.backend_bases import _Backend, FigureCanvasBase, FigureManagerBase, RendererBase, cursors
  from matplotlib.cbook import maxdict
  from matplotlib.figure import Figure
  from matplotlib.font_manager import findfont, get_font
  from matplotlib.ft2font import LOAD_FORCE_AUTOHINT, LOAD_NO_HINTING, LOAD_DEFAULT, LOAD_NO_AUTOHINT
  from matplotlib.mathtext import MathTextParser
  from matplotlib.path import Path
  from matplotlib.transforms import Bbox, BboxBase
  from matplotlib import colors
  from matplotlib.backends._backend_agg import RendererAgg
  from matplotlib import _png
label_desc: Use image node_id 26 for calling the RendererAgg obj's underlying member method code with example usage: obj.stop_filter(post_processing) without return types