3 Replies Latest reply on Jul 6, 2017 12:02 PM by Dan Ebberts

    Order Frames from Brightest to Darkest

    Arivl Level 1

      Hi, I have a rather thorny problem.  I'd like to take the frames in a video sequence, and re-order them from brightest average color to darkest.  If possible, via an expression on the time-remap parameter.


      Anyone have any tips?  Thanks so much in advance for any help!

        • 1. Re: Order Frames from Brightest to Darkest
          Mylenium Most Valuable Participant

          And "brightest" and "darkest" means what? Luminance? Predominant color? Percentage of a specific color? You see, already therein lies a can of worms waiting to be opened up. Likewise, reordering them with time-remapping would probably be extremely slow since you need to calculate the value for every frame and thge longer the layer, the more time it takes. It's not impossible, but it's going to be a major pain and requires much more detailed explanations.



          • 2. Re: Order Frames from Brightest to Darkest
            Arivl Level 1

            For now, I'm just taking the RGB channels and averaging them to get a single value, which roughly corresponds to luminance.  That part, I've figured out how to do.  It's the re-ordering part that's got me totally stumped!

            • 3. Re: Order Frames from Brightest to Darkest
              Dan Ebberts Level 5

              How are you getting the RGB values, sampleImage()? At each frame, your expression would have to take samples at every frame of the comp (huge cpu killer), then sort the results and the corresponding frame numbers, then, using the current frame number as an index into the array, get the appropriate frame number to display. Theoretically possible, but I doubt performance would be acceptable unless your comp is really short.