Print Page | Close Window

BW Dithered image renders to Gray Scale

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=849
Printed Date: 14 May 24 at 7:48AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: BW Dithered image renders to Gray Scale
Posted By: John Sigoloff
Subject: BW Dithered image renders to Gray Scale
Date Posted: 30 Dec 07 at 3:44PM
I have a black and white PDF that is rendered by QP to a gray scale image.  I have checked it with GhostScript and Adobe and it is a black and white.  The image was color and was converted to BW dithered (ie different BW patterns for different shades of gray).  Any help would be appreciated



Replies:
Posted By: marian_pascalau
Date Posted: 03 Jan 08 at 7:50AM
Send sample to support(at)quickpdf(dot)org


Posted By: Ingo
Date Posted: 03 Jan 08 at 8:15AM
Hi John!

Perhaps it's better to upload a sample online and post the link (with an error description) here - so anybody who's reading here can help and not only one ;-)

Best regards and a happy new year,
Ingo



Posted By: John Sigoloff
Date Posted: 03 Jan 08 at 11:17PM
See next post


Posted By: John Sigoloff
Date Posted: 03 Jan 08 at 11:18PM
See image: http://home.netcom.com/~jsiggy/BW_Renders_Gray.pdf - http://home.netcom.com/~jsiggy/BW_Renders_Gray.pdf  for an example of a BW Dithered image that renders gray & dithered...
 
Regards,
 
John


Posted By: Ingo
Date Posted: 04 Jan 08 at 2:48AM
Hi John!

Inside you can find this:
/ColorSpace /DeviceGray /BitsPerComponent 1
If tested with QP 5.21 ... It's gray scaled,
with Sumatra 0.6, Foxit Reader 2.2 and Adobe Reader 8.1 ... It looks always bw dithered.
Perhaps the reason is only the size of your qp-rendered image and it only seems to be gray scaled? If i reduce the zoom of the above readers the document seems to be gray scaled, too...?

Best regards,
Ingo




Posted By: lcarrere
Date Posted: 04 Jan 08 at 4:09AM
Hi all and happy new year.

Ingo,

As you know, IsedQuickPDF uses the GDI+ functions to draw images & shapes during the rendering process.

I haven't the source code of the library but I think the "problem" come from here:

When the bw image is drawn into a gdi+ graphics, the interpolation mode used are not InterpolationModeNearestNeighbor. In this case, with 1bpp rendering process the resulting drawn image appears as grayscale.

With GDI+ when we draw image into graphic kepping original size the best way is to set the Interpolation mode to InterpolationModeNearestNeighbor and the smoothing mode to SmoothingModeNone (see gdi+ reference guide).


Best regards,

Loïc Carrère


Posted By: John Sigoloff
Date Posted: 04 Jan 08 at 4:17PM
Loic et al,
 
setting the Interpolation mode to InterpolationModeNearestNeighbor (source required) and the smoothing mode to SmoothingModeNone solved the problem.  Thanks alot...
 
Cheers,
 
John




Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk