|
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
|