Batch conversion of large collection (40 000 pics) of JPG to AVIF or JXL
Posted: Tue Feb 25, 2025 12:55 am
Hi. I have a large photo collection and I would like to convert it to more modern format so that it consumes less space.
I have been comparing AVIF and JXL a lot and am probably ending towards AVIF because barely no normal apps (according to my tests on Galaxy S21FE) are able to view JXL files.
So there is large folder tree structure full of pictures, mainly JPG, newer ones are HEIC, then there are some CR2 from my old Canon EOS 400D and RW2 from my Panasonic Lumix LX-7 and NEF raw files also.
As there is 40 000 pics and hundreds of folders I cannot do every folder separately but have to automate some rutine to go through the tree hierarchy.
I am currently doing this for video/mp4 files with ffmpeg and some .bat files in windows and after that comes the picture project. There is .bat file that goes recursively through the whole tree hierarchy. Unfortunately videos are blended with pics partially to same folders.
First I was thinking of using ffmpeg also for this but ffmpeg seems unable to transfer EXIF and other metadata (if this is incorrect let me know).
So now I am thinking about XNView MP. It has batch mode but it seems to be aimed for single folders.
Can XNView MP batch mode or even single conversion be launched from command line with appropriate parameters?
(ps. not directly related but first I tried XNShell but it seems to have bug with AVIF conversion and produced files that many targets were unable to open).
Also I don't necessarily want to process yet the RAW files, JPGs are most important as they consume most space.
Mostly I will keep the resolution same but some very large pics I am considering resizing in the conversion.
Good tips how to approach this?
I have been comparing AVIF and JXL a lot and am probably ending towards AVIF because barely no normal apps (according to my tests on Galaxy S21FE) are able to view JXL files.
So there is large folder tree structure full of pictures, mainly JPG, newer ones are HEIC, then there are some CR2 from my old Canon EOS 400D and RW2 from my Panasonic Lumix LX-7 and NEF raw files also.
As there is 40 000 pics and hundreds of folders I cannot do every folder separately but have to automate some rutine to go through the tree hierarchy.
I am currently doing this for video/mp4 files with ffmpeg and some .bat files in windows and after that comes the picture project. There is .bat file that goes recursively through the whole tree hierarchy. Unfortunately videos are blended with pics partially to same folders.
First I was thinking of using ffmpeg also for this but ffmpeg seems unable to transfer EXIF and other metadata (if this is incorrect let me know).
So now I am thinking about XNView MP. It has batch mode but it seems to be aimed for single folders.
Can XNView MP batch mode or even single conversion be launched from command line with appropriate parameters?
(ps. not directly related but first I tried XNShell but it seems to have bug with AVIF conversion and produced files that many targets were unable to open).
Also I don't necessarily want to process yet the RAW files, JPGs are most important as they consume most space.
Mostly I will keep the resolution same but some very large pics I am considering resizing in the conversion.
Good tips how to approach this?