You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.
I've some scanned documents (sorry, I can't share the files) which due to the settings used for the scanning, have lost contrast and detail. The text was originally black and now is dark gray and the background is light gray instead of white. I can even see slightly the lines of text of the other page. pdf2djvu converts correctly the files and includes these annoying details.
I've been playing with the images (extracted with pdftoppm) in GIMP and the "Brightness-Contrast" tool enhances the image quality a lot. Just changing the contrast to 15, the text is black again and the light gray background disappears. Everything looks like a PDF with real text, not as a scanned image.
The GIMP tool is just a simple GUI which hides the details of the real tool, the levels editor. GraphicsMagick has a similar option to change the levels. You're already using GM to change the foreground colors, can you add another option to change the levels with GM?.
If you want to test the results, use some pdf with that problems, extract the images and open one with GIMP. Select Color and Brightness-Contrast. Check the option Preview and use the slider to change the contrast. In my case, the best setting is 15. Now click in the button Edit these settings as levels. In the first slider the settings are 22, 1.0 and 233. Close GIMP and run gm convert theimagefromthepdf -level '22,1.0,91%' output.png. I'm using a percentage here instead of the original number because GM's MaxRGB isn't 255 on my computer and the conversion fails. Use a cross multiplication to calculate the percentage.
The text was updated successfully, but these errors were encountered:
A change like this would really, really rock and would prevent me from having to "unpack" the PDF files with poppler's pdftoppm, like @juanfra684, run this kind of imagemagick/graphicsmagick and recompress the PDF files...
I have, countless times, wanted just this, but using the --monochrome option of pdf2djvu just created dithered images that made things hard to compress (and noisy)...
I've some scanned documents (sorry, I can't share the files) which due to the settings used for the scanning, have lost contrast and detail. The text was originally black and now is dark gray and the background is light gray instead of white. I can even see slightly the lines of text of the other page.
pdf2djvu
converts correctly the files and includes these annoying details.I've been playing with the images (extracted with
pdftoppm
) in GIMP and the "Brightness-Contrast" tool enhances the image quality a lot. Just changing the contrast to 15, the text is black again and the light gray background disappears. Everything looks like a PDF with real text, not as a scanned image.The GIMP tool is just a simple GUI which hides the details of the real tool, the levels editor. GraphicsMagick has a similar option to change the levels. You're already using GM to change the foreground colors, can you add another option to change the levels with GM?.
If you want to test the results, use some pdf with that problems, extract the images and open one with GIMP. Select
Color
andBrightness-Contrast
. Check the optionPreview
and use the slider to change the contrast. In my case, the best setting is15
. Now click in the buttonEdit these settings as levels
. In the first slider the settings are22
,1.0
and233
. Close GIMP and rungm convert theimagefromthepdf -level '22,1.0,91%' output.png
. I'm using a percentage here instead of the original number because GM's MaxRGB isn't 255 on my computer and the conversion fails. Use a cross multiplication to calculate the percentage.The text was updated successfully, but these errors were encountered: