A lot of questions include photographs of writing on paper (equations, diagrams, etc.) that were hastily taken in poor and/or uneven lighting. Is there a straightforward way to improve them?
Yes, there is.
The process is to first crop the image to remove all extraneous stuff outside the boundaries of the paper. For example, on the second one, I used:
convert -crop 3456x2000+0+1800 XGU75.jpg XGU75_a.jpg
Then, the following command uses a blurred copy of the image to approximate the lighting with the text and diagrams removed. This copy is negated and added to the original image in order to cancel out the effects of the uneven lighting, and then the contrast is stretched (normalized):
convert XGU75_a.jpg \( +clone -blur 30x30 -negate \) -compose Plus -composite -normalize XGU75_b.jpg
Finally, in some cases, it makes sense to convert the result to a binary (black and white rather than grayscale) PNG, which greatly reduces the file size:
convert -threshold 50000 XGU75_b.jpg XGU75_b.png
YMMV. Tweak the parameters as needed.
I think you are going in the wrong direction here.
Since we have tools for both diagrams & equations, why not remove those pictures alltogether and replace them with the right tools?
To take it a step further, i believe we should enforce that as a rule, i do not want to decipher an equation or a diagram on a crappy picture when the site provides good tools to write very clear ones.
Besides, it is not that hard to take a decent-quality picture of a diagram.
There are many tools to enhance image to make it more readable. The best tool is the one you learn to use well and if you have a lot, one with fast GUI interface for interactive optimization or batch processing if the optimization is identical.
In terms of theory, we might call it a transform, where by applying Shannon's Law to optimize spectral signal/noise ratio (SNR) we can reduce the error rate in viewing the contents. The transforms can include cropping, histogram normalization or simply applying fixed gamma, contrast and brightness values then applying sharpening values with colour contrast enhancement.
There are many software tools that are quick and easy to use, but it depends what you know how to use. I have used Picassa, Gimp, Photoshop, PSP, but for the longest time I have used Irfanview (free). These are all windows tools but you may prefer iOS or android image edit tools which all can work if you know how to manually edit gamma, contrast and brightness.
Example of IrfanView ( which has most of the features of ImageMagick and supports all the adobe .8bf plugins, if you have them.)
Often crop and autocorrect are good enough, but edit and manual adjust can improve if you understand how.
Say, you wanted to read the characters on the Chinese Checkers. It would take to long to show you how to automate or repeat saved settings, but this just to give you another snapshot impression of how image transformation can be done to improve readability.
From left original to right Bot.left corner going clockwise. 1) auto adjust 2) manual correct (gamma, contrast) 3) greyscale only 4) greyscale with gamma adjustment, contrast, brightness
Histogram graph of levels is inserted in some results to show the peak number of pixels at various levels from dark to light.