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.