Thank you for tying this together and posting it.
Very helpful. Just what I was looking for.
Easy to follow the script. I changed it to prompt for the Title and Author to use. File names on my computer are much different than how I want them on the Kindle.
To people confused why this exists, give it a try. I've been doing the same thing using some of the Windows software under Parallels. If you're trying to read text in a PDF image (i.e. a scanned document that you didn't do OCR on) the level and density corrections make a BIG difference. Line drawings / schematics are much easier to see as well.