          filename = os.path.splitext(os.path.basename(extract_media.filename))[0]
          extension = ".png"
          for idx, face in enumerate(extract_media.detected_faces):
              output_filename = "{}_{}{}".format(filename, str(idx), extension)
              face.hash, image = encode_image_with_hash(face.aligned.face, extension)
  
              if not self._args.skip_saving_faces:
                  saver.save(output_filename, image)
              final_faces.append(face.to_alignment())
          self._alignments.data[os.path.basename(extract_media.filename)] = dict(faces=final_faces)
 
</s> remove             basename = os.path.basename(filename)
            frame_name = os.path.splitext(basename)[0]
            extension = ".png"
            final_faces = []
 </s> add             src_filename = os.path.basename(filename)
            frame_name = os.path.splitext(src_filename)[0] </s> remove                 face.hash, b_image = encode_image_with_hash(aligned.face, extension)
 </s> add                 meta = dict(alignments=face.to_png_meta(),
                            source=dict(alignments_version=self._alignments.version,
                                        original_filename=output,
                                        face_index=face_idx,
                                        source_filename=src_filename,
                                        source_is_video=self._globals.is_video))

                b_image = encode_image(aligned.face, extension, metadata=meta) </s> remove                 final_faces.append(face.to_alignment())
            self._alignments.data[basename]["faces"] = final_faces
 </s> add  </s> remove             output = "{}_{}{}".format(frame_name, str(idx), extension)
            if self._arguments.large:
                self._frames.save_image(self._faces_dir, output, face.aligned.face)
            else:
                output = os.path.join(self._faces_dir, output)
                f_hash = self._extracted_faces.save_face_with_hash(output,
                                                                   extension,
                                                                   face.aligned.face)
                if self._is_legacy:  # Generate the new thumbnail and store new face data for save
                    face.thumbnail = generate_thumbnail(face.aligned.face, size=96, quality=60)
                    self._alignments.data[filename]["faces"][idx] = face.to_alignment()
                self._alignments.data[filename]["faces"][idx]["hash"] = f_hash
 </s> add             output = "{}_{}.png".format(frame_name, str(idx))
            meta = dict(alignments=face.to_png_meta(),
                        source=dict(alignments_version=self._alignments.version,
                                    original_filename=output,
                                    face_index=idx,
                                    source_filename=filename,
                                    source_is_video=self._frames.is_video))
            self._saver.save(output, encode_image(face.aligned.face, ".png", metadata=meta))
            if not self._arguments.large and self._is_legacy:
                face.thumbnail = generate_thumbnail(face.aligned.face, size=96, quality=60)
                self._alignments.data[filename]["faces"][idx] = face.to_alignment() </s> remove         extension = ".png"
 </s> add 
            meta = dict(alignments=face.to_png_meta(),
                        source=dict(alignments_version=self._alignments.version,
                                    original_filename=output_filename,
                                    face_index=idx,
                                    source_filename=extract_media.filename,
                                    source_is_video=self._images.is_video))
            image = encode_image(face.aligned.face, extension, metadata=meta)
          filename = os.path.splitext(os.path.basename(extract_media.filename))[0]
          extension = ".png"
          for idx, face in enumerate(extract_media.detected_faces):
              output_filename = "{}_{}{}".format(filename, str(idx), extension)
            meta = dict(alignments=face.to_png_meta(),
                        source=dict(alignments_version=self._alignments.version,
                                    original_filename=output_filename,
                                    face_index=idx,
                                    source_filename=extract_media.filename,
                                    source_is_video=self._images.is_video))
            image = encode_image(face.aligned.face, extension, metadata=meta)
  
              if not self._args.skip_saving_faces:
                  saver.save(output_filename, image)
              final_faces.append(face.to_alignment())
          self._alignments.data[os.path.basename(extract_media.filename)] = dict(faces=final_faces)
keep keep keep keep replace keep keep keep keep keep
 Update extracted faces to use PNG EXIF data (#1123)

Documentation
  - Update Usage.md, align.rst and image.rst
lib.image.py
  - read_image - Remove hash return, add metadata return
  - Remove read_image_hash functions
  - Add read_image_meta functios
  - Replace encode_image_with_hash with encode_image (to store metadata)
  - Add png meta reading and writing functions
  - Update Image Loaders/Savers to handle metadata rather than hashes
lib.training_data
  - Naming updates to remove references to hashes
lib.align.Alignments
  - Add versioning notes
  - Increment alignments version to 2.1
  - Deprecate hashing lookup functions
  - Replace filter_hashes with filter_faces
lib.align.detected_face
  - DetectedFace
    - Remove hash property
    - Add png header data serializing/deserializing functions
  - Mask
    - Add png header data serializing/deserializing functions
  - add update_legacy_png_header function to update png meta data
lib.cli.args - Deprecate alignments files for training
- plugins.train.trainer
  - Update alignments/mask code to read png header data
- scripts.convert
  - Aligned images folder - read data from png headers
- scripts.extract
  - Write png header information and no longer store hash of face
- tools.alignments
  - remove leftover-faces, merge and update-hashes jobs
  - Update jobs to use png meta data rather than hashes
- tools.manual
  - Update extract code to output png meta data and don't store hashes
  - Perform check on launch that tool is not pointing at a faces folder
tools.mask
  - Update to use png meta data
tools.sort
  - Update to use png meta data 
scripts/extract.py