          for i in range(img_new.shape[-1]):
              old_avg = img_old[:, :, i].mean()
              new_avg = img_new[:, :, i].mean()
              diff_int = (int)(old_avg - new_avg)
              for m in range(img_new.shape[0]):
                  for n in range(img_new.shape[1]):
                      temp = (img_new[m,n,i] + diff_int)
                      if temp < 0:
                          img_new[m,n,i] = 0
                      elif temp > 255:
                          img_new[m,n,i] = 255
                      else:
 
</s> remove     def adjust_avg_color(self,img_old,img_new):
        w,h,c = img_new.shape
        for i in range(img_new.shape[-1]):
            old_avg = img_old[:, :, i].mean()
            new_avg = img_new[:, :, i].mean()
 </s> add     @staticmethod
    def adjust_avg_color(old_face, new_face):
        """ Perform average color adjustment """
        for i in range(new_face.shape[-1]):
            old_avg = old_face[:, :, i].mean()
            new_avg = new_face[:, :, i].mean() </s> remove                         img_new[m,n,i] = 0
 </s> add                         new_face[int_h, int_w, i] = 0 </s> remove                         img_new[m,n,i] = 255
 </s> add                         new_face[int_h, int_w, i] = 255 </s> remove                         img_new[m,n,i] = temp
 </s> add                         new_face[int_h, int_w, i] = temp </s> remove         new_face = self.superpose(image, new_face, crop)
        original[slice(face_detected.y, face_detected.y + face_detected.h), slice(face_detected.x, face_detected.x + face_detected.w)] = cv2.resize(new_face, (face_detected.w, face_detected.h))
        return original
 </s> add         cv2.warpAffine(
            new_face,
            detected_face.adjusted_matrix,
            (detected_face.frame_dims[1], detected_face.frame_dims[0]),
            new_image,
            flags=cv2.WARP_INVERSE_MAP | cv2.INTER_CUBIC,
            borderMode=cv2.BORDER_TRANSPARENT)
        return new_image
            for int_h in range(new_face.shape[0]):
                for int_w in range(new_face.shape[1]):
                    temp = (new_face[int_h, int_w, i] + diff_int)
          for i in range(img_new.shape[-1]):
              old_avg = img_old[:, :, i].mean()
              new_avg = img_new[:, :, i].mean()
              diff_int = (int)(old_avg - new_avg)
            for int_h in range(new_face.shape[0]):
                for int_w in range(new_face.shape[1]):
                    temp = (new_face[int_h, int_w, i] + diff_int)
            for int_h in range(new_face.shape[0]):
                for int_w in range(new_face.shape[1]):
                    temp = (new_face[int_h, int_w, i] + diff_int)
            for int_h in range(new_face.shape[0]):
                for int_w in range(new_face.shape[1]):
                    temp = (new_face[int_h, int_w, i] + diff_int)
                      if temp < 0:
                          img_new[m,n,i] = 0
                      elif temp > 255:
                          img_new[m,n,i] = 255
                      else:
keep keep keep keep replace replace replace keep keep keep keep keep
 Fix convert-adjust (#531)

* Add dimensions to alignments + refactor

* Add frame_dims + funcs to DetectFaces. Add alignments lib

* Convert Adjust working

* Refactor and tidy up 
plugins/convert/Convert_Adjust.py