ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Detect whether page is monochrome

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
mwilliams 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
4   L A T E S T    R E P L I E S    (Newest First)
shackers Posted - Sep 30 2020 : 03:35:24
OK. Thanks. Perhaps I'll play a little more with it to fine tune.
xequte 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 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 Posted - Aug 23 2017 : 22:35:35
Hi

Have you tried Proc.CalcImageNumColors?

https://www.imageen.com/help/TImageEnProc.CalcImageNumColors.html

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com