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
 Why are both raw and jpg are ie24RGB?

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
tedfine Posted - Oct 28 2017 : 10:03:31
I need some help understanding camera raw formats.

TIEBitmap.Read opens both CR2 and jpg images as ie24RGB. That means 8 bits for each R, G, and B.

IrfranView agrees that both images are 24 bits/pixel.

8 bits for each color means that the range for each color is 0..255.

I thought that raw images had a maximum pixel depth (on the camera) far greater than 255.

How are camera raw images any better than plain jpgs if the R, G, and B values on both are limited to 255 maximum?

Why do I ask? I'm trying to create tool for photographers in dim lighting conditions to determine how over-exposed (and thus losing data to pixel wells on the sensor being full) or under-exposed (and thus bad SNR) their image is. This would be just like the histogram demo program.



4   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Oct 29 2017 : 20:31:47
Hi

Using ImageEnIO.NativePixelFormat (or with IEBitmap.ParamsEnabled = true, setting IEBitmap.IsNativePixelFormat to true) will load the Raw images as 48 bpp (16 bits per sample).

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Uwe Posted - Oct 29 2017 : 15:07:54
Ted, why don't you use something along these lines?


procedure WorkOnImage(View: TImageEnVect);
begin
  {...}
  with View.IO do
  begin
    NativePixelFormat := True;
    {...}


If you set NativePixelFormat to True then it makes no sense to use ie24RGB after loading. The format is set automatically depending on the image's native pixel format. For obvious reasons, using NativePixelFormat will often result in very dark images depending on their color depth.

In case you only want to read out the color depth of the image, use GetImageDetails.

https://www.imageen.com/help/GetImageDetails.html


You will only need RAW_QuickInterpolate if you want a fast, low-quality color interpolation.


Hope this helps
Uwe
tedfine Posted - Oct 28 2017 : 21:05:34
Hi, Uwe, Thanks for the helpful answer. Glad to hear I wasn't totally confused, just partially confused! :-)

Questions about my code below:

1. Where can I find LegacyBitMap since I'm not using ImageEndView (or must I use it?)
2. Should PF be ie24RGB after loading?

Thanks again for your help!

Ted

var
  bmp: TIEBitmap;
  ImageEnIO: TImageEnIO;
  PF: TIEPixelFOrmat;
begin
  Screen.Cursor := crHourGlass;
  bmp := TIEBitmap.Create;
  bmp.ParamsEnabled := TRUE;
  bmp.Params.RAW_QuickInterpolate := TRUE;  // <--- Is this necessary?

  ImageEnIO := TImageEnIO.CreateFromBitMap(bmp);
  ImageEnIO.NativePixelFormat := TRUE;
  ImageEnIO.LoadFromFile('C:\testfiles\i.cr2');
  PF := ImageEnIO.IEBitmap.PixelFormat;


Uwe Posted - Oct 28 2017 : 15:43:15
Check out TImageEnIO -> NativePixelFormat in the online documentation.

"By default, ImageEn converts all paletted images to 24 bit (true color). Only black/white images are stored in the original format with 1 bit per pixel. Setting NativePixelFormat to True disables the conversion and uses the image's native format."


Uwe