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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 How to distinguish file color
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

bjchang888

11 Posts

Posted - Dec 19 2014 :  03:03:48  Show Profile  Reply
Declaration

property BitsPerSample: integer;



Description

Depth, in bits, for each sample.
Allowed values:
Value Description
1 1 bit black & white
2 to 7 Color mapped bitmap (from 4 to 128 colors)
8 Color mapped (256 colors), 8 bit gray scale, 24 bit RGB, 48 bit CMYK, 24 bit CIELab
16 16 bit gray scale or 48 bit RGB
32 32 bit floating point


How to distinguish these types of Color mapped (256 colors), 8 bit gray scale, 24 bit RGB, 48 bit CMYK, 24 bit CIELab?

my name is shaojunchang.

spetric

Croatia
308 Posts

Posted - Dec 19 2014 :  13:42:58  Show Profile  Reply
Hi,

BitsPerSample value is number of bits (depth) per channel.
SamplesPerPixel value is number of channels.

Color mapped images have additional properties:
ColorMap array and ColorMapCount.

All those properties belong to IO.Params.

If you have TIEBitmap object, then you can check the type of image by inspecting IEBitmap.PixelFormat property (TIEPixelFormat).





Go to Top of Page

xequte

39140 Posts

Posted - Dec 22 2014 :  22:07:29  Show Profile  Reply
Also see BitsPerPixelToStr in iexHelperFunctions.pas:

http://www.imageen.com/help/BitsPerPixelToStr.html

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

bjchang888

11 Posts

Posted - Dec 22 2014 :  22:25:26  Show Profile  Reply
CODE#65306;
ImageEnView1.IO.LoadFromFile('E:\0001\1\8BitColorMap.tif');
// ImageEnView1.IO.LoadFromFile('E:\0001\1\8BitGray.tif');
case ImageEnView1.IEBitmap.PixelFormat of
ienull:addLog('Invalid pixel format.');
ie1g:addLog('Black/White (1 bit per pixel).');
ie8p:addLog('RGB color with colormap (256 colors, 8 bit per pixel).');
ie8g:addLog('Gray scale (256 shades of gray, 8 bit per pixel).');
ie16g:addLog('Gray scale (65536 shades of gray, 16 bit per pixel).');
ie24RGB:addLog('RGB true color (16M colors, 24 bit per pixel, 8 bit per channel).');
ie32f:addLog('Gray scale (0..1 floating point shades of gray, 32 bit per pixel).');
ieCMYK:addLog('CMYK color (32 bit per pixel, reversed 8 bit per channel).');
ie48RGB:addLog('RGB color (48 bit per pixel, 16 bit per channel).');
ieCIELab:addLog('CIELab color (24 bit per pixel, 8 bit per channel).');
ie32RGB:addLog('CIELab color (24 bit per pixel, 8 bit per channel).')
end;


The results are displayed
RGB true color (16M colors, 24 bit per pixel, 8 bit per channel).

Still can not determine the type of color.

my name is shaojunchang.
Go to Top of Page

bjchang888

11 Posts

Posted - Dec 22 2014 :  22:30:59  Show Profile  Reply
BitsPerSample = 8 and SamplesPerPixel = 1
The results are returned:
Color mapped (256 colors), 8 bit gray scale, 24 bit RGB, 48 bit CMYK, 24 bit CIELab

How then distinguish these types?

my name is shaojunchang.
Go to Top of Page

spetric

Croatia
308 Posts

Posted - Dec 23 2014 :  02:41:06  Show Profile  Reply
If BitsPerSample = 8 and SamplesPerPixel = 1
it can not be 24 bit RGB, because 24 bit RGB must have SamplesPerPixel = 3.
It can only be one channel bitmap with 8 bits depth (256 intensity levels).

It can be color mapped image, but then ColorMap array will not be NULL,
and ColorMapCount will not be 0.
Go to Top of Page

spetric

Croatia
308 Posts

Posted - Dec 23 2014 :  03:42:14  Show Profile  Reply
From your previous post:

"The results are displayed
RGB true color (16M colors, 24 bit per pixel, 8 bit per channel).

Still can not determine the type of color."

You have actually determined the type of color, it's 24-bit RGB image.
It has 3 channels and 8-bits per channel.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: