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 : Monday, March 31, 2008 10:47:27 PM(UTC)

MychaL  
MychaL

Groups: Registered
Posts: 10


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.
 

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 : Monday, March 31, 2008 10:54:47 PM(UTC)

MychaL  
MychaL

Groups: Registered
Posts: 10


ggggrrr.....Error

>>> Cf.save image to grayscale color.
 
#3 Posted : Tuesday, April 1, 2008 4:33:03 AM(UTC)

Adam Boulad  
Guest

Groups: Guests
Posts: 3,022

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


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?
 
#4 Posted : Tuesday, April 1, 2008 9:43:07 PM(UTC)

MychaL  
MychaL

Groups: Registered
Posts: 10


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



 
#5 Posted : Wednesday, April 2, 2008 1:36:51 AM(UTC)

Adam Boulad  
Guest

Groups: Guests
Posts: 3,022

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






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.

File Attachment(s):
Sample.zip (1,139kb) downloaded 20 time(s).
 
#6 Posted : Friday, April 4, 2008 4:42:44 AM(UTC)

MychaL  
MychaL

Groups: Registered
Posts: 10



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.



 
#7 Posted : Wednesday, May 14, 2008 6:27:30 AM(UTC)

Adam Boulad  
Guest

Groups: Guests
Posts: 3,022

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


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.
 
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.442 seconds.