IIXC_Page Darkness

PDF-XChange Editor SDK for Developers

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

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
jeffp
User
Posts: 914
Joined: Wed Sep 30, 2009 6:53 pm

IIXC_Page Darkness

Post by jeffp »

Is there a property or procedure with IIXC_Page that will give me a "darkness" factions of sorts.

I have another image package that does this and it is defines as

"the fraction of an image that consists of "dark" pixels (i.e., pixels that would be black if the image was converted to B&W)"

I'm using this with a blank page detection option where I let the user determine a blank threshold and compare it against the page "darkness" to know whether do discard it or not.

Any help would be greatly appreciated.

--Jeff
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: IIXC_Page Darkness

Post by Sasha - Tracker Dev Team »

Hello Jeff,

If I understood what you need correctly, then you can use the https://sdkhelp.pdf-xchange.com/vie ... ountColors property to get number of different colors that page has. If the color count is 1 then the page is blank. You can additionally look at the first pixel's color to see whether is is white (if you need this).

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
jeffp
User
Posts: 914
Joined: Wed Sep 30, 2009 6:53 pm

Re: IIXC_Page Darkness

Post by jeffp »

Let me try again. The image will already be a B&W image so ColorCount will be 2.

I'm looking for the fraction of a B&W image that contains dark pixels.

--Jeff
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: IIXC_Page Darkness

Post by Sasha - Tracker Dev Team »

Hello Jeff,

Probably this method will help:
https://sdkhelp.pdf-xchange.com/vie ... Histogramm

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply