  
      os.replace(tmp_filename, filename)
  
  
  def encode_image(image, extension, metadata=None):
      """ Encode an image.
  
      Parameters
      ----------
      image: numpy.ndarray
 
</s> remove     def _save(self, filename: str, image: bytes, sub_folder: Optional[str]) -> None:
 </s> add     def _save(self,
              filename: str,
              image: Union[bytes, np.ndarray],
              sub_folder: Optional[str]) -> None: </s> remove     def save(self, filename: str, image: bytes, sub_folder: Optional[str] = None) -> None:
 </s> add     def save(self,
             filename: str,
             image: Union[bytes, np.ndarray],
             sub_folder: Optional[str] = None) -> None: </s> remove     def frame_metadata(self) -> dict:
 </s> add     def is_aligned(self) -> bool:
        """ bool. ``True`` if :attr:`image` is an aligned faceswap image otherwise ``False`` """
        return self._is_aligned

    @property
    def frame_metadata(self) -> "PNGHeaderSourceDict": </s> remove             logger.error("Failed to save image '%s'. Original Error: %s", filename, err)
 </s> add             logger.error("Failed to save image '%s'. Original Error: %s", filename, str(err)) </s> remove         The original frame
 </s> add         The original frame or a faceswap aligned face image
def encode_image(image: np.ndarray,
                 extension: str,
                 metadata: Optional["PNGHeaderDict"] = None) -> bytes:
  
      os.replace(tmp_filename, filename)
  
  
def encode_image(image: np.ndarray,
                 extension: str,
                 metadata: Optional["PNGHeaderDict"] = None) -> bytes:
      """ Encode an image.
  
      Parameters
      ----------
      image: numpy.ndarray
keep keep keep keep replace keep keep keep keep keep
 Update Face Filter
  - Remove old face filter
  - plugins.extract.pipeline: Expose plugins directly
  - Change `is_aligned` from plugin level to ExtractMedia level
  - Allow extract pipeline to take faceswap aligned images
  - Add ability for recognition plugins to accept aligned faces as input
  - Add face filter to recognition plugin
  - Move extractor pipeline IO ops to own class 
lib/image.py