Welcome to LEAD Support Forum Login | Register | Faq  

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

Re: Help
Started by MychaL at 04-01-2008 3:52. Topic has 6 replies.

Print Search « Previous Thread Next Thread »
  04-01-2008, 3:52
MychaL is not online. Last active: 4/7/2008 9:40:37 AM MychaL

Top 200 Posts
Joined on 08-04-2006
Posts 15
Help
Reply Quote
The grayscale funtion works. But the save function doesnt keep parameters...

Maybe we have to set the good palette ? How can we do that ?

Thanks.

   Report 
  04-01-2008, 3:59
MychaL is not online. Last active: 4/7/2008 9:40:37 AM MychaL

Top 200 Posts
Joined on 08-04-2006
Posts 15
Re: Help
Reply Quote
ggggrrr.....Error

>>> Cf.save image to grayscale color.

   Report 
  04-01-2008, 9:38
Adam Boulad is not online. Last active: 10/9/2008 4:18:21 PM Adam Boulad



Top 10 Posts
Joined on 09-16-2007
Posts 425
Re: Help
Reply Quote

Hello,

Can you please tell provide me with the following:

1- What Programming language and LEADTOOLS programming interface (.NET, DLL API, C++ Class Library, etc.) are you using?

2- What LEADTOOLS version (13, 14, 14.5, 15, etc.) are you using?

3- How are you saving the image exactly? If you are facing an error, can you tell me the exact error message that you are getting?

4- Could you explain the issue in more details?
Adam Boulad
LEADTOOLS Technical Support

   Report 
  04-02-2008, 2:48
MychaL is not online. Last active: 4/7/2008 9:40:37 AM MychaL

Top 200 Posts
Joined on 08-04-2006
Posts 15
Re: Help
Reply Quote
Sorry, i made an error when i wanted to post an answer on precedent topic....

i had posted :

i'm testing components, and i would like to save an image to grayscale....


i have tested this code :

FImg.grayscale(8);
FImg.UseLUT := True;
FImg.ColorRes(8, CRF_BYTEORDERGRAY,  CRF_NODITEHRING, 0);
FImg.Save('c:\test.tif', FILE_TIF, 8, 0, SAVE_OVERWRITE);

nb: Leadtools 14.5 used with Delphi.

But when i open the file with Kodak Imaging, the file is recognized as a 256 colors instead 256 grayscale

Any idea ?
Thanks


   Report 
  04-02-2008, 6:41
Adam Boulad is not online. Last active: 10/9/2008 4:18:21 PM Adam Boulad



Top 10 Posts
Joined on 09-16-2007
Posts 425
Re: Help

Attachment: Sample.zip
Reply Quote

Hello,
1. I recommend that you use the GrayScale(8) method without the ColorRes method, because in your case it adds nothing.

2. All 8-bit images (and less) in LEADTOOLS have palettes. The grayscale images will have a grayscale palette.

There is a flag in the toolkit to store TIFF images as grayscale without a palette, like the attached NoPalette.tif. Is this what you want? This flag is only available in LEADTOOLS Raster Imaging Pro or higher toolkits, so if you need it, please send me your LEADTOOLS Pro serial number to support@leadtools.com.


Adam Boulad
LEADTOOLS Technical Support

   Report 
  04-04-2008, 9:47
MychaL is not online. Last active: 4/7/2008 9:40:37 AM MychaL

Top 200 Posts
Joined on 08-04-2006
Posts 15
Re: Help
Reply Quote

We wanted to test product possibilities (LT Document Imaging Suite 14.5), and we have some problems with grayscale 8 bits pictures.

We tried a simple exemple :

·         Load a tif image (8 bits, grayscale, 300 dpi).

·         Save the image in another file by a new LeadImage (and even without a new LeadImage, directly with the first one).

But when we checked the file with Kodak Imaging (windows 2000), the file is recognized as 256 colors and not as 256 grayscale. The problem is probably the palette which is used, so how to set some palette, and keep parameters to save the file ?

 

This is our code with Delphi  :

    Src.Load(‘c:\in.tif’, 0, 0, 1);

    if (Src.IsGrayscale <> GRAY_NO) then

        begin

                Dst.PaintSizeUseDPI := True;

                Dst.CreateBitmap(Round(Src.RgnWidth), Round(Src.RgnHeight), Dst.BitmapBits);

                // Dst.Fill(RGB(255, 255, 255));

 

                MyDC  := Src.GetClientDC;

                MyDDB := Src.GetDDB(MyDC);

                MyPalette := Src.GetBitmapPalette(MyDC);

                Dst.SetDDB(MyDC, MyDDB, MyPalette);

 

// Src.SetRgnRect (0, 0, Src.BitmapWidth, Src.BitmapHeight, L_RGN_SET);

                // Dst.SetRgnRect (0, 0, Src.BitmapWidth, Src.BitmapHeight, L_RGN_SET);

                // Dst.CombineExt (0, 0, Src.RgnWidth, Src.RgnHeight, Src.Bitmap, 0, 0, CB_OP_AND + CB_DST_NOP);

                // Dst.ForceRepaint;

                Dst.Save ('C:\out.tif', Src.InfoFormat, Src.InfoBits, 0, SAVE_OVERWRITE);

        end;


Thanks.




   Report 
  05-14-2008, 11:32
Adam Boulad is not online. Last active: 10/9/2008 4:18:21 PM Adam Boulad



Top 10 Posts
Joined on 09-16-2007
Posts 425
Re: Help
Reply Quote

The ability to save a TIF file without a flag is not available in the VCL interface.

However, there are Pascal (Delphi) wrappers for our DLLs, and since you have a LEADTOOLS Document Imaging toolkit, these wrappers should be installed on your PC under LEADTOOLS14.5\USES
 

Also, you can use the DLL functions such as L_SaveBitmap with the image from the LEAD VCL controls. To do that, pass the VCL control's Bitmap property as the BITMAPHANDLE pointer needed for these functions such as:
L_SaveBitmap('filename', pBitmapHandle(LEADImage1.bitmap), ...)

You will need pass a SAVEFILEOPTION structure to the L_SaveBitmap function, and set the Flags property to ESO_NOPALETTE.
Adam Boulad
LEADTOOLS Technical Support

   Report 
Post
LEAD Support Fo... » Developer » Color Conversio... » Re: Help

Powered by Community Server, by Telligent Systems