Enhance contrast of scanned pages, and convert RGB "greyscale" to indexed colour to reduce file size

Forum for the PDF-XChange Editor - Free and Licensed Versions

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Post Reply
DIV
User
Posts: 252
Joined: Fri Jun 23, 2017 1:47 am

Enhance contrast of scanned pages, and convert RGB "greyscale" to indexed colour to reduce file size

Post by DIV »

Hello.

When working with scanned pages of documents, two issues that come up are poor legibility and large file sizes.

I am (now) aware that you include functionality to "Enhance Scanned Pages" within PDF-XChange Editor (version 7.0). I say upfront that I have not played with this.
However, one aspect of poor legibility that I have seen on multiple occasions is the text being too pale: that is, grey text on a white background in the scan, but 'black' (i.e. very dark grey) text on a 'white' (i.e. "white paper"-coloured) background in the original. What I would have liked when dealing with those documents is a tool to boost the contrast of the scanned image, to increase the darkness of the text (without [much] compromising the whiteness of the background). I haven't yet seen this available.
When I make my own scans, I tend to boost the contrast to/near the maximum on the scanner itself, but sometimes scanners are poorly configured/configurable, and there are also many occasions where the scan has been made by someone else.

Regarding the file sizes, I'm aware there's a trade-off between image quality and file size. Just one thing I noticed when performing OCR on a greyscale scanned document in another application: it displayed a message that it was "converting to indexed colour" (or something like that), which resulted in file size shrinking from about 7.6 MB to 4.9 MB. Admittedly the individual pixels in the image looked different when highly magnified, but AFAIK the resolution was unchanged. I assume that the colour indexing retained only a limited number of grey shades (e.g. maybe 64 would be sufficient to be practically undetectable by the human eye). In that application I cannot see a way to convert to indexed colour without performing OCR, and I don't see a way to do it in PDF-XChange Editor at all — both offer instead ability to decrease resolution to produce a smaller file. Maybe this would be a useful functionality to add?

Extensions to this would be to convert colour-scanned documents to greyscale or B&W.

Both of the latter seem like they could be handled in the existing GUI through the "Optimise PDF" dialogue box, with an additional field named (say) "Output" for the "Color Images" section, the "Grayscale Images" section and the "Indexed Images" section, with user-selectable options being: "Color Image", "Grayscale Image", "Indexed Image" and "Monochrome Image" for the first of these; "Grayscale Image", "Indexed Image" and "Monochrome Image" for the second of these; and "Indexed Image" and "Monochrome Image" for the last of these. Obviously the default would be no change (matching current behaviour).
Well, conceptually the proposed new field wouldn't require much change to the GUI, although practically when I look closely it might get a bit squashy, and would probably require either lots of little tweaks such as abbreviating/changing some names (e.g. "Compression" becomes "Format", "Quality" becomes "Qual.") and shrinking the drop-down boxes and shifting existing boxes leftward, and the word "Image" can be omitted from each option of the proposal; or else adding an extra line in each section and making the pane scrollable.

Yours sincerely,
DIV
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8544
Joined: Wed Jan 03, 2018 6:52 pm

Re: Enhance contrast of scanned pages, and convert RGB "greyscale" to indexed colour to reduce file size

Post by TrackerSupp-Daniel »

Hello DIV,

When working with documents, we do expect that the images already hold the desired appearance, as we are not an image editing software. We do offer the ability to "Edit image with X application" simply by right clicking on the image. If you need to modify the contrast or other aspects of the image we suggest using specialized tools to do so.

As for indexed color, I believe you are correct that currently there is no was to do this without optimizing the PDF, and I will speak with the dev team to see if this is possible to be done in the "recompress images" dialog, or to incorporate it with another function.

Regarding converting to greyscale. This is indeed possible from the "recompress images" function on a per image basis, and we do have an active feature request to create a bulk "recompress all images" function. Whether this will appear as part of the "Optimize PDF" function or not, it is too early to say, however we will certainly consider that as an option as we develop this.

Kind regards,
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
DIV
User
Posts: 252
Joined: Fri Jun 23, 2017 1:47 am

Re: Enhance contrast of scanned pages, and convert RGB "greyscale" to indexed colour to reduce file size

Post by DIV »

Thanks, Daniel.

So for the contrast there is an indirect method to do it per image — or per page in the case of scanned documents. That's good enough for documents that aren't too long. I accept your point about not being an image-editing application per se. Nevertheless I see there being a spectrum of transformations between those that are essential and those that are far out of scope.
Something like:
Optimise PDF (e.g. convert to greyscale or B&W) ➨ Recompress image (e.g. convert to monochrome, with dithering) ➨ Adjust contrast ➨ Apply sharpening filter ➨ Apply a solarising filter ➨ ....
My perspective is that the boundary should be between those features helpful for many users, and those helpful to very few users. I reckon contrast adjustment fits on the side of being helpful to many, but I respect that others' opinions & experience on that may differ.

For saving as indexed colour, I couldn't actually see it in the Recompress Images dialogue or the Save as Optimized dialogue. Maybe it is something that is handled as an automatic choice by the software, to select it only if it reduces the file size?

You mentioned that conversion of all images to greyscale will appear as a functionality of the Bulk Recompress Images toolset. That seems good enough to me. And probably easier for users to find than the right-click per-image Recompress Images dialogue. It does seem like that same functionality could also be made accessible from the Optimise PDF dialogue.

Regards,
DIV
Last edited by DIV on Mon Mar 04, 2019 9:34 am, edited 3 times in total.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17892
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Enhance contrast of scanned pages, and convert RGB "greyscale" to indexed colour to reduce file size

Post by Tracker Supp-Stefan »

Hello DIV,

Thanks for your feedback!
Indeed a Recompress All, especially is also available as part of the Optimization process should do nicely for your needs!

For the moment I do not have much more to add here - so let's wait and see what our devs will implement!

Regards,
Stefan
Post Reply