So I checked out ImageMagick, it wasn't really for me, so I ended up using TheGimp's Script-Fu to first off write a batch procedure to convert all files in a folder to the nearest (bigger) power of two, and optionally scale the image down afterwards if it is too big. This is a simplified version (I can give anyone the batch if needed).
(define
(script-fu-resize-upper-pot image drawable)
(let*
(
;; Store upper power of two for height and width of image
(height (pow 2 (ceiling (/ (log (car (gimp-image-height image))) (log 2)))))
(width (pow 2 (ceiling (/ (log (car (gimp-image-width image))) (log 2)))))
)
;; Resize the Image
(gimp-image-resize image width height 0 0)
)
)
Of course the big problem with this is that the Script-Fu command file-glob only allows you to cycle through one folder, and you have to use a very ugly batch call for it to work :
"c:\Program Files\GIMP-2.0\bin\gimp-2.6.exe" -i -b "(script-fu-resize-upper-pot-batch \"C:\\ImageData\\*.png\" 0) (gimp-quit 0)"
So the next problem was to iterate through the folders to call the gimp script on all of them, after a bit of testing, I found this PowerShell script :
Clear-Host
$Directory = "C:\PuddleSqData\"
$Dirs = Get-ChildItem -path $Directory -recurse -include * | where {$_.PsIsContainer}
$Gimp = "gimp-console-2.6.exe"
foreach($Dir in $Dirs)
{
$SourcePath = $Dir.FullName
$GimpifiedSourcePath = $SourcePath -replace("\\", "\\")
$GimpParams = @("-i", "-b", "`"(script-fu-resize-upper-pot-batch \`"$GimpifiedSourcePath\\*.png\`" 0)`"", "-b", "`"(gimp-quit 0)`"")
Write "Calling $GIMP $GimpParams"
$p = [diagnostics.process]::Start($Gimp, $GimpParams)
$p.WaitForExit()
}
And everything is now working!
I guess that maybe ImageMagick would have been a better solution, it's just a shame that TheGimp proposes a batching process that really isn't powerful enough.
Hope this helps someone!