Batch Merge Alpha and RGB images together (same filenames - different extensions)
Posted: 2019-03-21T10:58:04-07:00
I have thousands of Alpha (.tiff) and RGB (.png) images I need to merge together and output to .tga format with alpha channel.
This command works for merging 2 images into 1:
How do I batch it on thousands of images in subfolders and output to same source?
I tried this:
It doesn't work/returns errors.
I think the problem is with (*). I need to replace that * with something else but don't know what. need %g to read/write filename without extension name.
This command works for merging 2 images into 1:
Code: Select all
magick convert "a.png" "a.tiff" -alpha off -compose CopyOpacity -composite "a.tga"
I tried this:
Code: Select all
for /r %g in (*) do magick convert "%g.png" "%g.tiff" -alpha off -compose CopyOpacity -composite "%g.tga"
I think the problem is with (*). I need to replace that * with something else but don't know what. need %g to read/write filename without extension name.