Thanks for the suggestion - this works but I did notice there is a significant drop in image quality when converting from jpg to either avif or jxl even if I use -quality 100 in the command line (and the size is also larger than the source image).
So I did a bit of testing. If I use the native Magick command magick -quality 75% I get a smaller file size than the original and no drop in quality. It looks like behind the scenes, the command above is actually converting the file to a temp png file first, and then converting that to jxl. Is the double conversion causing the drop in quality, and if so is there any way to avoid that? My understanding is that jxl and avif can support smaller file sizes with the same quality, so I want to convert all my stored photos from my phone to one of those formats if I can using Dopus.