Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Floating Point Pixels in Output Module (HELP!)

Participant ,
Oct 19, 2017 Oct 19, 2017

This is driving me crazy.  I tried to update an output module I had written (and used extensively years ago) which simply finds the average pixel value for each color and writes it to a text file.  (I am trying to evaluate effects that manipulate film frames of solid colors that have been scanned and want to get the average rather than just some random pixel.) 

The updated version works with 16-bit comps but I need to use in now on floating point comps since some of the frames may have 'super whites" in them.  The values I get for floating point pixels in the plug-in seem to bear no relationship to the values I see in the Info panel in After Effects.

As a test I created a sequence of solids filled with equal RGB having the following values:

1.0, 0.8, 0.6, 0.4, 0.2, 0, 1.5, 2.0

What I see in the plug-in is pixel values of

1.0, 0.6038, 0.3185, 0.1329, 0.0331, 0, 2.5495, 5.0199

I can see that the plug-in thinks the depth of the image is 96 and the pixel format is PF_PixelFormat_ARGB128.

Does anybody have any idea why I am seeing this or where I should look for the problem?

Does anyone see a mathematical relationship between those sequences of values?  It must be some kind of exponential function, right?

TOPICS
SDK
618
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 19, 2017 Oct 19, 2017

OK.  It is an exponential function:  x^0.999999.

WTF

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 19, 2017 Oct 19, 2017

No, apparently Excel is playing with my brain.  I give up.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 20, 2017 Oct 20, 2017

At the risk of embarrassing myself even more, I'm going to venture the opinion that the relationship between the two sequences of numbers is parabolic.  I did a project with a solid whose color animates from 0 to 3.0 in steps of 0.05 and ran my output plug-in to read the average pixel values for each frame and plotted the resulting values in Excel.  It looks like half a parabola to me, but I cannot make Solver in Excel figure out the exact parameters for the parabola.  It comes pretty close, but the very bottom end is still off.

Not that this is at all relevant to my real problem which is figuring out how to get valid pixel values in an output module for floating point projects.  The sample project FBIO is limited to 8 and 16 bit pixels, but I thought I had changed the necessary flags or settings to make my output plug-in work with floating point pixels.  It sees the pixel format as floating point, but the values are screwy.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 21, 2017 Oct 21, 2017
LATEST

It occurs to me that the problem may be the way I am accessing the floating point pixels in the AddFrame function.

Is there something wrong with this code:

   switch (pixelFormat)

    {

           

        case PF_PixelFormat_ARGB128:        // float pixel values

           

            layer32Pixel = (PF_Pixel32 *)(wP->data);

           

            for(row = 0; row <wP->height; row ++)

            {

                layer32Pixel = (PF_Pixel32*)((Ptr)wP->data + row * wP->rowbytes);

                         // CAN I ASSUME A FLOATING POINT IMAGE HAS NO PADDING

               

                for(col = 0; col < wP->width; col++)

                {

                    redTotal += layer32Pixel->red;

                    greenTotal += layer32Pixel->green;

                    blueTotal += layer32Pixel->blue;

                    pixelCount++;

               

                    layer32Pixel++;

                }

             }

     }

           

            break;

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines