      def set_display_image(self) -> None:
          """ Obtain the scaled image and set to :attr:`display_image` """
          logger.debug("Setting display image. Scale: %s", self._scale)
          image = self.source[..., 2::-1]  # TO RGB
          if self._scale != 1.0:
              interp = self._interpolation if self._scale > 1.0 else cv2.INTER_NEAREST
              dims = (int(round(self.source.shape[1] * self._scale, 0)),
                      int(round(self.source.shape[0] * self._scale, 0)))
              image = cv2.resize(image, dims, interpolation=interp)
          self._display = ImageTk.PhotoImage(Image.fromarray(image))
 
</s> remove     def __init__(self, save_variable: tk.BooleanVar) -> None:
        logger.debug("Initializing %s: (save_variable: %s)",
                     self.__class__.__name__, save_variable)
 </s> add     def __init__(self, save_variable: tk.BooleanVar, is_standalone: bool) -> None:
        logger.debug("Initializing %s: (save_variable: %s, is_standalone: %s)",
                     self.__class__.__name__, save_variable, is_standalone)
        self._is_standalone = is_standalone </s> remove         size = 256 if self.command == "convert" else 128
        get_images().load_latest_preview(thumbnail_size=int(size * get_config().scaling_factor),
                                         frame_dims=(self.winfo_width(), self.winfo_height()))
        self.display_item = get_images().previewoutput
 </s> add         size = int(256 if self.command == "convert" else 128 * get_config().scaling_factor)
        if not self._preview.load_latest_preview(thumbnail_size=size,
                                                 frame_dims=(self.winfo_width(),
                                                             self.winfo_height())):
            logger.trace("Preview not updated")  # type:ignore
            return
        logger.debug("Preview loaded")
        self.display_item = True </s> remove     def resize_image(self, name: str, frame_dims: Optional[Tuple[int, int]]) -> None:
        """ Resize the training preview image based on the passed in frame size.
 </s> add         """
        size = get_config().user_config_dict.get("icon_size", 16)
        size = int(round(size * get_config().scaling_factor))
        icons: Dict[str, ImageTk.PhotoImage] = {}
        pathicons = os.path.join(PATHCACHE, "icons")
        for fname in os.listdir(pathicons):
            name, ext = os.path.splitext(fname)
            if ext != ".png":
                continue
            img = Image.open(os.path.join(pathicons, fname))
            img = ImageTk.PhotoImage(img.resize((size, size), resample=Image.HAMMING))
            icons[name] = img
        logger.debug(icons)
        return icons
        if self._scale not in (0.0, 1.0):  # Scale will be 0,0 on initial load in GUI
      def set_display_image(self) -> None:
          """ Obtain the scaled image and set to :attr:`display_image` """
          logger.debug("Setting display image. Scale: %s", self._scale)
          image = self.source[..., 2::-1]  # TO RGB
        if self._scale not in (0.0, 1.0):  # Scale will be 0,0 on initial load in GUI
              interp = self._interpolation if self._scale > 1.0 else cv2.INTER_NEAREST
              dims = (int(round(self.source.shape[1] * self._scale, 0)),
                      int(round(self.source.shape[0] * self._scale, 0)))
              image = cv2.resize(image, dims, interpolation=interp)
          self._display = ImageTk.PhotoImage(Image.fromarray(image))
keep keep keep keep replace keep keep keep keep keep
 GUI - Preview updates
  - Training preview. Embed preview pop-out window
  - Bugfix - convert/extract previews 
lib/training/preview_tk.py