Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, July 28, 2009 7:22:06 AM(UTC)

Kiima  
Kiima

Groups: Registered
Posts: 25


Hey there! Is there a way to see if a PDF is black and white? I've tried checking the BPP, but CodecsImageInfo returns 24 even if the image is black and white. Please advise.

Thanks,
Kiima
LeadTools 16.5, Windows VB.NET

 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Wednesday, July 29, 2009 5:51:24 AM(UTC)

Adam Boulad  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

Kiima,
You could do this by:
1. Loading the PDF file as 24-bit.
2. Count the unique colors in the file using the ColorCountCommand Class function:
- If the number of colors is more than two, the image will not be black and white.
3- If the number of colors is 2 or less, perform ColorResolutionCommand Class with the
ColorResolutionCommandPaletteFlags.Optimized flag.
4- Check entries of the palette to see if they are black and white entries.

 
#3 Posted : Wednesday, July 29, 2009 6:15:16 AM(UTC)

Kiima  
Kiima

Groups: Registered
Posts: 25


Thanks for the response....I'll test it out today.

On a related note, which PDF compression format would you recommend for the black and white images? I've tried the RasPdfG4 format, but the images look pixely. We use the RasPdfJpeg411 format for color pdfs.

Thanks,
  -Kiima
LeadTools 16.5, Windows VB.NET
 
#4 Posted : Thursday, July 30, 2009 4:57:28 AM(UTC)

Adam Boulad  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

CCITT Group4 usually gives very good compression, especially with document-like images.
JBIG and JBIG 2 can give higher compression, but they're only available in LEADTOOLS Document Imaging and above. For more information, please check the product comparison chart at our website.
The issue could be related to the bitmap's resolution. What is the source image? Is it also PDF? If yes, are you setting its loading DPI to a high value?

 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.084 seconds.