1

I sometimes take screenshots on my Mac during video-calls with friends/family (with their consent of course!) and would like to add those images of a photographic nature to my Apple Photos Library. I have considered these options/alternatives:

  1. Add the PNGs as-is to Apple Photos: But a lossless image format such as PNG for pictures which photographic content is a waste of storage by a factor of 10-20x. Apple Photos has no function "Compress this file in the library". Hence I need external pre-processing.
  2. Set JPEG as the output format for macOS's native screenshot command. That's possible. But I do my screenshot spontaneously, hence I would need to switch that option all the time, and until I switched the situation on screen may already be over. So this is no option either.
  3. Hence leave PNG as the default for maximal quality preservation. And where it makes sense compress in a post-processing later, before adding to the Photo Library.

So does any one know and CLI tools or GUI apps for that purpose?

1 Answer 1

0

I) Use ImageMagick to perform the batch processing from PNG to JPG while preserving the timestamp:

mogrify -verbose -define preserve-timestamp=true -format jpg -quality 60% -path ./output/ ./input/*.png
  • preserve-timestamp correctly preserves the creation and modification timestamps in the filesystems.
  • But in the EXIF header timestamps are NOT created!
  • As I read in a forum post from 10/2018 writing EXIF metadata seems not to be in the scope of ImageMagick.
  • Hence the use of another tool:

II) Use ExifTool to copy the creation date in the filesystem to the creation and modification date in the filesystem and into the EXIF header of the file.

exiftool "-alldates<filecreatedate" -overwrite_original_in_place -P ./output/
  • overwrite_original_in_place causes that this remains the same file, hence the creation date stays as-is.
  • -P preserves the modification timestamp of the original file which is overwritten in place.
  • And the EXIF timestamp is also updated because it's included in -alldates.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.