T O P I C R E V I E W |
bjchang888 |
Posted - Dec 19 2014 : 03:03:48 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. |
6 L A T E S T R E P L I E S (Newest First) |
spetric |
Posted - Dec 23 2014 : 03:42:14 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. |
spetric |
Posted - Dec 23 2014 : 02:41:06 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. |
bjchang888 |
Posted - Dec 22 2014 : 22:30:59 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. |
bjchang888 |
Posted - Dec 22 2014 : 22:25:26 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. |
xequte |
Posted - Dec 22 2014 : 22:07:29 Also see BitsPerPixelToStr in iexHelperFunctions.pas:
http://www.imageen.com/help/BitsPerPixelToStr.html
Nigel Xequte Software www.xequte.com nigel@xequte.com |
spetric |
Posted - Dec 19 2014 : 13:42:58 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).
|
|
|