The easy solution is always worth a try, but in this case I'd be worried that the overhead of calling and starting up the external program would be prohibitive for millions of files.
When's the last time you used duct tape on a duct? --Larry Wall
Comment on Re^2: Recursive image processing (with ImageMagic)