PDF-XChange - Tracker PDF Viewer - TIFF-XChange - Image-XChange - XMF-XChange - Raster-XChange - Support

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

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.
 
jeffp
User
Topic Author
Posts: 837
Joined: Wed Sep 30, 2009 6:53 pm

Convert To BW

Thu Mar 29, 2018 9:12 pm

I have an IIXC_Page object that is a gray scale image. I need to convert it into a black and white image.

Here is what I'm using currently

var
APage: IIXC_Page;
begin
APage.ConvertToFormat(PageFormat_1Indexed);
APage.Set_FmtInt(FP_ID_ITYPE, 1);
APage.Set_FmtInt(FP_ID_BPP, 1);

However, the last line that sets the BPP to 1 inverts the image so what was white is now black.

Is this the correct way to covert a gray scale image to black and white? If not, how would you suggest I accomplish this with the IIXC_Page object?

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

Re: Convert To BW

Fri Mar 30, 2018 10:11 am

Hello Jeff,

Are you using the Editor SDK or Core API?

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
 
jeffp
User
Topic Author
Posts: 837
Joined: Wed Sep 30, 2009 6:53 pm

Re: Convert To BW

Fri Mar 30, 2018 12:19 pm

I need to be able to make this conversion via the API in code. Again using the IIXC_Page object.
 
User avatar
Sasha - Tracker Dev Team
User
Posts: 3108
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Convert To BW

Mon Apr 02, 2018 8:57 am

Hello Jeff,

Can you please give us a full sample, that does this conversion and also, that will give us the same presentation of the result that you have (to investigate the inverse part), because this code alone is not enough to make a correct judgement.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
 
jeffp
User
Topic Author
Posts: 837
Joined: Wed Sep 30, 2009 6:53 pm

Re: Convert To BW

Wed May 16, 2018 3:24 pm

I'm having a hard time finding the sample file that wasn't working.

Can I just ask what calls you would make to turn a GrayScale or Color image into a BW image?

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

Re: Convert To BW

Thu May 17, 2018 12:28 pm

Hello Jeff,

We've implemented the IIXC_Page::ReduceColorsFixedPalette method that will allow you to set the needed colors palette (in your case the Black and White colors) and make the image BW. This will be available from the next release (326).
PS: No release ETA yet.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
 
jeffp
User
Topic Author
Posts: 837
Joined: Wed Sep 30, 2009 6:53 pm

Re: Convert To BW

Thu May 17, 2018 2:13 pm

Thanks.
 
User avatar
Sasha - Tracker Dev Team
User
Posts: 3108
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Convert To BW

Thu May 17, 2018 2:32 pm

:)
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

Who is online

Users browsing this forum: No registered users and 2 guests