class_docstr: A Tkinter-compatible photo image.  This can be used
  everywhere Tkinter expects an image object.  If the image is an RGBA
  image, pixels having alpha 0 are treated as transparent.
  
  The constructor takes either a PIL image, or a mode and a size.
  Alternatively, you can use the ``file`` or ``data`` options to initialize
  the photo image object.
  
  :param image: Either a PIL image, or a mode string.  If a mode string is
                used, a size must also be given.
  :param size: If the first argument is a mode string, this defines the size
               of the image.
  :keyword file: A filename to load the image from (using
                 ``Image.open(file)``).
  :keyword data: An 8-bit string containing image data (as loaded from an
                 image file).
class_docstr_tok: ["A","Tkinter-compatible","photo","image",".","This","can","be","used","everywhere","Tkinter","expects","an","image","object",".","If","the","image","is","an","RGBA","image",",","pixels","having","alpha","0","are","treated","as","transparent",".","The","constructor","takes","either","a","PIL","image",",","or","a","mode","and","a","size",".","Alternatively",",","you","can","use","the","``","file","``","or","``","data","``","options","to","initialize","the","photo","image","object",".",":","param","image",":","Either","a","PIL","image",",","or","a","mode","string",".","If","a","mode","string","is","used",",","a","size","must","also","be","given",".",":","param","size",":","If","the","first","argument","is","a","mode","string",",","this","defines","the","size","of","the","image",".",":","keyword","file",":","A","filename","to","load","the","image","from","(","using","``","Image.open","(","file",")","``",")",".",":","keyword","data",":","An","8-bit","string","containing","image","data","(","as","loaded","from","an","image","file",")","."]
docstr: Paste a PIL image into the photo image.  Note that this can
  be very slow if the photo image is displayed.
  
  :param im: A PIL image. The size must match the target region.  If the
             mode does not match, the image is converted to the mode of
             the bitmap image.
  :param box: A 4-tuple defining the left, upper, right, and lower pixel
              coordinate. See :ref:`coordinate-system`. If None is given
              instead of a tuple, all of the image is assumed.
docstr_tok: ["Paste","a","PIL","image","into","the","photo","image",".","Note","that","this","can","be","very","slow","if","the","photo","image","is","displayed",".",":","param","im",":","A","PIL","image",".","The","size","must","match","the","target","region",".","If","the","mode","does","not","match",",","the","image","is","converted","to","the","mode","of","the","bitmap","image",".",":","param","box",":","A","4-tuple","defining","the","left",",","upper",",","right",",","and","lower","pixel","coordinate",".","See",":","ref",":","`","coordinate-system","`",".","If","None","is","given","instead","of","a","tuple",",","all","of","the","image","is","assumed","."]
code: def paste(self, im, box=None):
      """
      Paste a PIL image into the photo image.  Note that this can
      be very slow if the photo image is displayed.
  
      :param im: A PIL image. The size must match the target region.  If the
                 mode does not match, the image is converted to the mode of
                 the bitmap image.
      :param box: A 4-tuple defining the left, upper, right, and lower pixel
                  coordinate. See :ref:`coordinate-system`. If None is given
                  instead of a tuple, all of the image is assumed.
      """
  
      # convert to blittable
      im.load()
      image = im.im
      if image.isblock() and im.mode == self.__mode:
          block = image
      else:
          block = image.new_block(self.__mode, im.size)
          image.convert2(
              block, image
          )  # convert directly between buffers
  
      tk = self.__photo.tk
  
      try:
          tk.call("PyImagingPhoto", self.__photo, block.id)
      except tkinter.TclError:
          # activate Tkinter hook
          try:
              from . import _imagingtk
  
              try:
                  if hasattr(tk, "interp"):
                      # Required for PyPy, which always has CFFI installed
                      from cffi import FFI
  
                      ffi = FFI()
  
                      # PyPy is using an FFI CDATA element
                      # (Pdb) self.tk.interp
                      #  <cdata 'Tcl_Interp *' 0x3061b50>
                      _imagingtk.tkinit(
                          int(ffi.cast("uintptr_t", tk.interp)), 1
                      )
                  else:
                      _imagingtk.tkinit(tk.interpaddr(), 1)
              except AttributeError:
                  _imagingtk.tkinit(id(tk), 0)
              tk.call("PyImagingPhoto", self.__photo, block.id)
          except (ImportError, AttributeError, tkinter.TclError):
              raise
  
file_path: pillow-simd/src/PIL/ImageTk.py
imports: import tkinter
  from io import BytesIO
  from .None import Image
label_desc: Use image node_id 6 for calling the PhotoImage obj's underlying member method code with example usage: obj.paste(im, box) without return types