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
 ie32f. Save to 32bit Tiff Image

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
supersk Posted - Dec 18 2018 : 04:36:08
I used the following code to generate a 32bit tiff image file:
imgtmp->IEBitmap->PixelFormat = ie32f;
imgtmp->IEBitmap->Height = RImage->GetHeight();
imgtmp->IEBitmap->Width = RImage->GetWidth();
imgtmp->IO->Params->BitsPerSample = 32;
imgtmp->IO->Params->SamplesPerPixel = 1;

//Generate 32bit TIFF
float *P32;
for (int i = 0; i <= imgtmp->IEBitmap->Height - 1; i++) {
P32 = (float*)imgtmp->IEBitmap->Scanline[i];
for (int j = 0; j <= imgtmp->IEBitmap->Width - 1; j++) {
P32[j] = RImage->fData[i][j]/255.0;
}
}
imgtmp->IO->SaveToFileTIFF(DstFile);

Result: Only generate a 174Byte file, How can I do#65311; Thanks a lot.
3   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Dec 21 2018 : 04:20:12
Hi

The current version of ImageEn does not support ie32f, but we have just added it. Please email me for a pre-release.

You can save to save ie32f pixel format as follows:

  imageenview.LegacyBitmap := false;
  imageenview.IEBitmap.PixelFormat := ie32f;
  imageenview.IO.Params.BitsPerSample := 32;
  imageenview.IO.Params.SamplesPerPixel := 1;
  imageenview.IO.Params.TIFF_PhotometInterpret := ioTIFF_BLACKISZERO;
  imageenview.IO.params.TIFF_Compression := ioTIFF_UNCOMPRESSED;
  imageenview.IO.SaveToFile('test.tiff');

Note: TIFF_Compression must be ioTIFF_UNCOMPRESSED, ioTIFF_LZW, ioTIFF_PACKBITS or ioTIFF_ZIP


Nigel
Xequte Software
www.imageen.com
supersk Posted - Dec 19 2018 : 02:20:37
I Add the params as following, but it doesn't work:
imgtmp->LegacyBitmap = false; // Do not use TBitmap
imgtmp->IEBitmap->PixelFormat = ie32f;
imgtmp->IEBitmap->Height = RImage->GetHeight();
imgtmp->IEBitmap->Width = RImage->GetWidth();

imgtmp->IO->NativePixelFormat = true; // Use the original pixel format
imgtmp->IO->Params->BitsPerSample = 32;
imgtmp->IO->Params->SamplesPerPixel = 1;
imgtmp->IO->Params->TIFF_Compression = ioTIFF_UNCOMPRESSED;


//#29983;#25104;32#20301;TIFF#22270;
float *P32;
for (int i = 0; i <= imgtmp->IEBitmap->Height - 1; i++) {
P32 = (float*)imgtmp->IEBitmap->Scanline[i];
for (int j = 0; j <= imgtmp->IEBitmap->Width - 1; j++) {
P32[j] = RImage->fData[i][j]/255.0;
}
}
imgtmp->IO->SaveToFileTIFF(DstFile);

and I use the following code to generate 16bit tiff image, it work!
imgtmp->IEBitmap->PixelFormat = ie16g;
imgtmp->IEBitmap->Height = RImage->GetHeight();
imgtmp->IEBitmap->Width = RImage->GetWidth();
imgtmp->IO->Params->BitsPerSample = 16;
imgtmp->IO->Params->SamplesPerPixel = 1;

//16#20301;TIFF#22270;
WORD *P16;
double constscale = 65536.0/255.0;
for (int i = 0; i <= imgtmp->IEBitmap->Height - 1; i++) {
P16 = (WORD*)imgtmp->IEBitmap->Scanline[i];
for (int j = 0; j <= imgtmp->IEBitmap->Width - 1; j++) {
P16[j] = RImage->fData[i][j]*constscale;
}
}
imgtmp->IO->SaveToFileTIFF(DstFile);
Why?
xequte Posted - Dec 18 2018 : 21:26:41
Hi

What is your value for:

imgtmp->IO->Params->TIFF_Compression

https://www.imageen.com/help/TIOParams.TIFF_Compression.html


Nigel
Xequte Software
www.imageen.com