Is this just going to be for your own personal usage? Or is this for an actual book?
Was this a bunch of inline images instead of Arabic text? (I know I have run across similar problems with crappy conversions of Greek text.)
As you know, trying to UPSCALE things will result in some subpar images... but if you just needed something a little quick/dirty, I dabbled in this for a little and came up with this basic workflow.
Step 1
Original Image:
First you upscale the image:
Code:
convert test2.png -scale 1000% test2[Scaled1000].png
Note: You can insert any % there. 1000% makes it 10x larger.
Step 2
Then you can adjust the contrast slightly:
Code:
convert test2[Scaled1000].png -contrast-stretch 3% test2[ContrastTweak3].png
Note: You can insert any % there. I found that anywhere from 1-5% seemed decent. Going beyond that distorted the text too much.
Step 3
Then you can scale the image down:
Code:
convert test2[ContrastTweak3].png -scale 40% test2[ScaledDown40].png
Note: You can use whatever % or size you want here. This results in a final image that is 4x larger.
Step 4
If you wanted to convert on an entire folder of PNGs, just go to the folder and run this:
Code:
convert *.png -scale 1000% -contrast-stretch 3% -scale 40% -set filename:fname %t_tn +adjoin %[filename:fname].png
Note: If you have a ton of images, probably better to run mogrify or come up with some sort of batch file. I read about the
convert -set filename method here:
https://www.imagemagick.org/Usage/ba...ogrify_convert
You could also probably introduce more steps in between (different resizing filters, etc. etc.), but I am not that familiar with that. Most of the time I am just using Imagemagick to clean up speckling in scans. :P