I like taking pictures, but I like it even more to archive them such that I can easily find them back. I do this by applying keywords, having correct timestamps, embedding GPS locations, and compressing them such that they all fit on my phone. Budgetting 32GB for storage and ~30k photos & videos gives a reasonble ~1MB per photo or video, I’m currently at ~360 KB per photo or video.
TL;DR: I’m lazy and set my camera image recording quality settings to JPEG at medium resolution at normal detail. If you’re a pixel peeper you want RAW at fine detail (photographylife.com).
I don’t have time for RAW processing most of the time, so I use JPEG storage. After choosing that, I compared the options Fine-Large, Normal-Large, Fine-Medium, Normal-Medium on my 15-85mm f/3.5-5.6 IS USM lens (dxomark.com). I didn’t notice a difference so I settled for the smallest filesize (Normal-Medium) for simplicity. Note that DXomark rates my lens to have an 8 MPixel sharpness (dxomark.com), which means the medium resolution of 11 MPixel is more than sufficient to capture all lens details. Even cropping is not an argument here as the lens simply doesn’t generate more detail.
I used the following script to generate 100% crops, setting quality to 95 explicitly to ensure equal treatment:
The above settings give me 2-3 MB JPEG pictures out of my EOS 80D camera, and similarly sized HEIC images from my iPhone SE 2020. Most of the time I view my pictures on my phone or on a table, where I need only ~2MP at medium quality. Since I prefer to have many images with me, I use below workflow to select, compress, and port back photos to my phone
I store all pictures in folders per event, grouped per year, e.g. 2021/20211225_christmas_dinner. The folder name is important as it will be used as IPTC tag when exporting.
iOS/macOS stores geotags in the moov/meta atom of mp4 metadata. This is not
where ffmpeg or exiftool store video geotags normally. To mitigate this, I
use the following approach:
Geotag videos using exiftool (using XMP metadata). Alternatively do this via your favorite GUI. Using exiftool allows interpolating a gpx track so I don’t have to do it manually and can base my video geotags on existing other geotags.
Harvest geotag metadata stored in the moov/meta atom from an existing iOS video using bento4 SDK mp4extract
Update the moov/meta atom manually using the XMP geotag in the video file
Transplant the updated moov/meta atom in the new video using mp4edit
This is somewhat hacky but it seems to work reliably. The moov/meta atom
stores more data than just geotag, such as iPhone model and iOS version, so
each transplanted video will have this wrong metadata.
I have a non-GPS camera to take proper pictures in addition to my smartphone camera. One drawback is that this camera does not geotag my pictures. A solution to this is using the smartphone pictures as reference. exiftool can be used to automate this.
Method:
Ideally: when taking non-geotaggedpictures, also take a few geotagged pictures to serve as waypoints
Create GPX file from geotagged pictures
Use GPX file to tag non-geotagged pictures, interpolating where necessary
N.B.
Personal note: when using (Guru Maps) GPS tracks, do not use manually waypoints - time might be off (delete manually from GPX)
EXIF does not store timezone, therefore set computer clock to country where pictures were taken OR apply -geosync offset as (computer time zone) - (picture timezone), i.e. GMT+1 - GMT+2 = -geosync=-1:00:00
If there was no movement in between geotracks (i.e. at home/hotel), use longer GeoMaxIntSecs to allow broader interpolation.
TL;DR: Compress to 2 Mpixel @ 60% quality for JPEG or 4 MPixel @ 40% quality for HEIC (giving 20% additional file reduction)
I compress pictures using ImageMagick’s convert, ensuring the biggest side is 1920 pixels (-geometry 1920x1920), we never upscale (imagemagick.org) (some rare source images have low res) (using \>), set quality to 60% (-quality 60).
Alternatively, you can set the pixel area count limit (imagemagick.org). This will ensure output is always 2 Megapixel (good), but wide aspect-ratio (e.g. panorama) images could be difficult to see (bad).
To assess which quality we need, I ran the following script on a series of test images. I used 2 MPixel JPEG @ 60% quality as benchmark, and looked at various HEIC qualities at both 2 Mpixel and 4 Mpixel. The hypothesis is that a higher pixel count at lower quality can give same result at lower filesize.
ARRQUALJPEG=(9060)ARRQUALHEIC=(4050)find ./3_conversion_quality/ -type f -iname "IMG*"|whileread -r SRCFILE;dofor quality in "${ARRQUALJPEG[@]}";dooutfile=$(basename "${SRCFILE%.*}-q${quality}.jpg") convert -geometry 1920x1920\> -quality "${quality}""${SRCFILE}""${outfile}"echo"$(basename ${SRCFILE}),jpg,${quality},$(du -k ${outfile}| cut -f 1)"donefor quality in "${ARRQUALHEIC[@]}";dooutfile1=$(basename "${SRCFILE%.*}-2MP-q${quality}.heic") convert -geometry 2073600@\> -quality "${quality}""${SRCFILE}""${outfile1}" exiftool -tagsfromfile "${SRCFILE}" -exif:all --MakerNotes --IFD1 --ThumbnailImage -P -overwrite_original "${outfile1}"echo"$(basename ${SRCFILE}),heic,${quality},$(du -k ${outfile1}| cut -f 1)"outfile2=$(basename "${SRCFILE%.*}-4MP-q${quality}.heic") convert -geometry 3686400@\> -quality "${quality}""${SRCFILE}""${outfile2}" exiftool -tagsfromfile "${SRCFILE}" -exif:all --MakerNotes --IFD1 --ThumbnailImage -P -overwrite_original "${outfile2}"echo"$(basename ${SRCFILE}),heic,${quality},$(du -k ${outfile2}| cut -f 1)"infile3=$(basename "${SRCFILE%.*}-q90.jpg")outfile3=$(basename "${SRCFILE%.*}-heif-q${quality}.heic") heif-enc --quality ${quality} -o "${outfile3}""${infile3}"echo"$(basename ${SRCFILE}),heic2,${quality},$(du -k ${outfile3}| cut -f 1)"done# Now calculate at what HEIC quality we get ~30% file size reduction vs original# i.e. # target filesize = 70% * reference filesize# target filesize = fsize40 + deltaQ * (fsize50 - fsize40 / 10)# deltaQ = (target filesize - fsize40)/(fsize50 - fsize40 / 10)# finalQ = deltaQ + 40reffile=$(basename "${SRCFILE%.*}-q60.jpg")refsize=$(gdu --bytes ${reffile}| cut -f 1)tgtsize=$(echo"$refsize * 0.70"| bc -l)ARRPREFIX=("-4MP""-2MP""-heif")for pref in "${ARRPREFIX[@]}";dotgtfile40=$(basename "${SRCFILE%.*}${pref}-q40.heic")tgtfile40=$(basename "${SRCFILE%.*}${pref}-q50.heic")tgtsize40=$(gdu --bytes ${tgtfile40}| cut -f 1)tgtsize50=$(gdu --bytes ${tgtfile50}| cut -f 1)deltaq=finalq=donedone# For each source image, search the HEIC image that is smaller for each setting: ImageMagick @ 2Mpixel & 4Mpixel, heif-enc @ 2Mpixelfind ./3_conversion_quality/ -type f -iname "IMG*"|whileread -r SRCFILE;do# Show reference file & sizereffile=$(basename "${SRCFILE%.*}-q60.jpg")refsize=$(gdu --bytes ${reffile}| cut -f 1) gfind . -name "${reffile}" -printf '%s, %p\t'# Show first smaller converted files & sizesARRPREFIX=("-4MP""-2MP""-heif")for pref in "${ARRPREFIX[@]}";dotgtprefix=$(basename "${SRCFILE%.*}${pref}")tgtfile=$(gfind . -name "${tgtprefix}*" -size "-${refsize}c" -printf '%s, %p\n'| sort -n | tail -n 1)echo -n "$tgtfile\t"doneecho""done
I haven’t solved this one yet. I did find methods that don’t work:
mp4extract moov IMG_2983.MOV test# does not work, movie not recognized, but geotag metadata shown in findermp4edit --replace moov:test IMG_2983.MOV.mp4 IMG_2983.MOV_edit.mp4
mp4extract 'moov/meta' IMG_2983.MOV test# geotag recognized and shown in finder, but not contentidentifiermp4edit --insert moov:test IMG_2983.MOV.mp4 IMG_2983.MOV_edit.mp4
# geotag not recognizedmp4edit --insert moov/meta:test IMG_2983.MOV.mp4 IMG_2983.MOV_edit.mp4
I tag my files with the words from the directory name such that I can find them back later. I want these to work on Apple (iOS and macOS) because those are my platforms for viewing photos.
I transfer photos to iPhone/iOS using the Rollit app (apple.com) because Apple’s photo syncing has been notoriously unreliable for me (it sometimes gets into a corrupted(?) state that it doesn’t sync anymore). I view my photos on my iPhone or iPad.