Author |
Topic  |
|
mwilliams
United Kingdom
9 Posts |
Posted - Aug 23 2017 : 12:57:43
|
I have an app which can be required to upload thousands of pages of documents to a document server. To reduce the amount of time involved in uploading and to reduce the required size of the server, I have tried to write a function which determines whether the relevant pages are monochrome text documents or rather can they be satisfactorily treated as monochrome and thereby saved in a lower quality tiff format rather than jpeg.
The code I have developed so far is not terribly accurate (to say the least). What I am looking for is a function which is commonly found on scanners, whereby they automatically detect whether or not a page needs to be saved in colour.
Is there a function within ImageEn for doing this or, if not, is there one in IEVision?
Thanks |
|
xequte
    
38988 Posts |
|
shackers

United Kingdom
28 Posts |
Posted - Sep 29 2020 : 06:05:13
|
Long time responding to this post! Sorry.
What I need is a function which can determine if it is safe to treat a document as if it is monochrome. If so I am saving it as a basic monochrome tiff to maximize size reduction.
I know that some scanners provide a similar function and perform an educated guess as to whether a document needs to be saved as colour or monochrome. So, for example, they may treat a document as monochrome where it has a single band of colour along the top.
I have had a bit of a play with CalcImageNumColors, submitting some out monochtrome text files, grayscale photos and colour photos.
The text files produced results of 256 colours or lower. The grayscale images 30,000 colours or over The colour images 140,000 colours or over.
I am thinking that a sensible approach may be to treat anything under 1000 colours as monochrome. Would you agree with that?
Many thanks.
|
 |
|
xequte
    
38988 Posts |
Posted - Sep 30 2020 : 03:08:34
|
OK, that seems reasonable. Though, naturally, you will still get some quality loss when downscaling an image with hundreds of gray levels to just black and white.
Nigel Xequte Software www.imageen.com
|
 |
|
shackers

United Kingdom
28 Posts |
Posted - Sep 30 2020 : 03:35:24
|
OK. Thanks. Perhaps I'll play a little more with it to fine tune. |
 |
|
|
Topic  |
|