You can use ImageMagick with the auto-level
or level
flags.
convert input.jpg -auto-level output.jpg
convert input.jpg -level 1%,99% output.jpg
On Linux or Mac, you can use a bash
control structure to perform the operation on multiple image files.
for f in *.jpg ; do
convert "$f" -level 1%,99% "${f%.jpg}-level.jpg"
done
I don't know the equivalent command forFor Windows, you can install a bash
shell, like Cygwin or Windows Subsystem for Linux. Anyone
Anyone who knows the native cmd
or PowerShell commands for Windows, feel free to edit to add.