ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 TIFF 16bit gray scale

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
carlonarcisi Posted - Feb 24 2017 : 03:41:16
I'm trying to convert an image TIFF 16Bit grayscale in TIFF 8bit grayscale. (image format destination would be any format .. )
I can show TIFF 16bit grayscale image with ImageJ program (https://imagej.nih.gov/ij/) and by imagej I have exported image in 8bit grayscale.
So I written the following command like you Nigel has suggested

ImageEnIO1.LoadFromFileTIFF('TIFF16.TIF');
ImageEnIO1.Params.BitsPerSample := 8;
ImageEnIO1.Params.SamplesPerPixel := 1;
ImageEnIO1.Params.SaveToFile('pippo.tif');

But file has nothing ..

what can I do ?


attach/carlonarcisi/201722433931_FOTO.zip
3158.66 KB

attach/carlonarcisi/201722434033_Source.zip
1.86 KB
4   L A T E S T    R E P L I E S    (Newest First)
carlonarcisi Posted - Feb 26 2017 : 09:04:24
GREAT !
It's work ! thanks too much
Carlo
w2m Posted - Feb 25 2017 : 10:55:48
 
ImageEnIO1.LoadFromFileTIFF('TIFF16.TIF');
But file has nothing ...


TIFF16.TIF appears to be a medical image in 16-bit grayscale.
ImageEn can read it but it's all black!

The image contains an invisible range of values.
To show the image you should adjust the visible range using ImageEnView.IEBitmap.BlackValue and WhiteValue. This is done automatically if you call AutoCalcBWValues():

The file TIFF16.TIF can be loaded and viewed with:
procedure TForm1.Open1Click(Sender: TObject);
begin
  if OpenImageEnDialog1.Execute then
  begin
    ImageEnView1.LegacyBitmap := False;
    ImageEnView1.IO.NativePixelFormat := True;
    ImageEnView1.IO.LoadFromFile(OpenImageEnDialog1.FileName);
    ImageEnView1.IEBitmap.AutoCalcBWValues;
  end;
end;

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
carlonarcisi Posted - Feb 25 2017 : 00:24:07
hello bill
you're right, I was wrong the way to save the image .. but the problem continues
"pippo.tiff" the file created is a black image.
I do not think it's enough to convert a 16-bit image grayscale to 8bit grayscale change BitsPerSample end SamplesPerPixel.
if I open TIFF16.TIF with ImageEn or by any other viewer I always get a black picture .. only if I use ImageJ or a viewer for medical images I see the file (I am attaching a screenshot)
To convert the image to an 8bit grayscale I did not want to install ImageJ to all my customers .. I hope the ImageEn could solve the problem

Carlo

w2m Posted - Feb 24 2017 : 09:10:09
ImageEnIO1.LoadFromFileTIFF('TIFF16.TIF');
ImageEnIO1.Params.BitsPerSample := 8;
ImageEnIO1.Params.SamplesPerPixel := 1;
ImageEnIO1.SaveToFile('pippo.tif');

You have to save the image so use SaveToFile not Params.SavetoFile.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development