When you use Photos to Import new images and video and click Review for Import, the application reviews the selected images and displays them for confirmation. The display is split into "Already Imported" and "New Photos".
What is the algorithm Photos uses to determine if the image already exists?
Is it based on filename and location, such that if the same file is imported from a different folder it will be a "New Photo"?
It can't be based on filename alone, as there would be too many false positives.
Is it based on a hash of the image data?
Update, 2019-10-21: I have previously used Image Capture to export iPhone images not in their native format (i.e. HEIC is converted to JPEG). I then imported those into the Photos application. Later, I used Image Capture to export iPhone images in their native format. When I attempt to import those, it appears that Photos does not see them as duplicates and wants to import them as new photos. I wonder if this behavior would be the same if I imported directly from the phone.
I have a similar concern with respect to photos imported automatically via Photo Stream. Photo stream does not support live photos. So if I later import those live photos from the phone (or turn on iCloud Photos, e.g.), will it duplicate those images?