Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

Please help in converting color image to black and white.
Started by hemantbkulkarni at 06-12-2007 2:17. Topic has 1 replies.

Print Search « Previous Thread Next Thread »
  06-12-2007, 2:17
hemantbkulkarni is not online. Last active: 6/29/2007 10:18:05 AM hemantbkulkarni

Top 150 Posts
Joined on 11-09-2006
Posts 15
Please help in converting color image to black and white.
Reply Quote


HI

I am using this code below  to convert color image to black and white.

RasterProc.ColorRes (LEADRasterView1.Raster, 1, CRP_OPTIMIZEDPALETTE,

CRD_FLOYDSTEINDITHERING, 0)

I am using code below to save the images. I think there is somethink wrong in this. Will you please enlight me in this regard.

ldio.Save LEADRasterView2.Raster, "D:\Images\TEST\BlackandWhiteTest1", FILE_JPEG_411, 0, QFACTOR_ABCQ_LOSSLESS_FAST, 0

These group of  code is not converting color images to black and white images.

So I am using the code given below.

RasterProc.DynamicBinary( LEADRasterView3.Raster, 32, 32);

This converts both Color and Grayscale images to black and white without changing the bits per pixel.But there is one problem with this , here each pixel is compared to a dynamically-calculated threshold. If the intensity of the pixel is higher  than the dynamic threshold, the pixel will be set to white. If the intensity of the pixel is lower than the dynamic threshold, the pixel will be set to black because of this , images are losing the information. ie lightly drawn lines are not seen as pixels become white there. So is there any method to set this threshold intensity to some desired value.

my questions are

1. why above code is not converting the color images to black and white ? I am attaching the image converted using your code.

2. How control this threshold intensity factor?

3. Is there any other better way to convert the images to black and white without losing the information from images.

 

 

Thanks in advance.

 With Regards

 Hemant BK


   Report 
  06-13-2007, 11:03
Qasem Lubani is not online. Last active: 9/2/2008 11:31:52 AM Qasem Lubani



Top 10 Posts
Joined on 08-13-2006
Posts 1,044
Re: Please help in converting color image to black and white.
Reply Quote

If you need to convert a color image to black and white, there are different ways of getting there, but the best one depends on the image contents, and the desired result.

Please attach one or more color images, and describe how you want them to become.

Important notes:

1. The system does not allow all types of attachments, so make sure to put all files into one ZIP or RAR file before attaching.

2. Please specify which LEADTOOLS version you're using (13, 14, etc.)


Qasem Al-Lubani
LEAD Technical Support
www.leadtools.com
   Report 
Post
LEAD Support Fo... » Developer » Color Conversio... » Please help in converting color image to black and white.

Powered by Community Server, by Telligent Systems