I am using 3 band jpeg files with 1 band png masks for image analysis. The names match except for extension, and I am merging the jpgs using gdalbuildvrt, then gdal_translate to generate a geotiff. I would like to merge the pngs in the same manner (reusing my existing scripts if possible), but my mask generator does not create a worldfile.
tileset_nn_0_0.jpg tileset_nn_0_0.jpg.aux.xml tileset_nn_0_0.png tileset_nn_1_0.jpg tileset_nn_1_0.jpg.aux.xml tileset_nn_1_0.png tileset_nn_2_0.jpg ...
The worldfile I have for the jpgs is a PAM/GDAL dataset, and looking inside the files, they won't work by just renaming because they include attributes regarding JPEG compression, bands, etc that don't exist in the pngs.
I have thought of using gdal_translate to convert each jpg image to a grayscale png in a temp directory, then delete the png and copy the worldfile out, but I will be doing this repeatedly for several datasets, so I would prefer a cleaner solution.