Image data range

  • On 23/08/2015 at 03:48, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   R14 
    Platform:   Windows  ;   
    Language(s) :     C++  ;

    Hi folks,

    could someone clarify for me how I can get the data range of a given image? For instance, I have an image that ranges in colour values from 0-65535. How can I test for this data value range programmatically? I'm needing to get which data range the images are in, i.e. are they 0-255, 0-65535, 0.0-1.0.



  • On 23/08/2015 at 04:09, xxxxxxxx wrote:

    255 = 8 bits
    65535 = 16 bits
    float = 32 bits "and it can go out of range (0.f - 1.f)"

    BaseBitmap yourBitmap = ...;  
    Int32 bits = yourBitmap.GetBt();  

  • On 23/08/2015 at 18:10, xxxxxxxx wrote:

    Hi Mohammed,

    that's what I thought. I'd been using COLORMODE to get the mode flag, but an experiment I ran was giving me an image with 0-65535 an 8 bit data range. It must be something else. I'll need to keep digging.



  • On 24/08/2015 at 07:59, xxxxxxxx wrote:


    I think, GetBt() is more what you'll want.
    There's also a Python example script, how to use it in the Python SDK examples:
    It should be easily transferable to C++.

Log in to reply