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

A question about color blending formula in AE

New Here ,
Jun 17, 2024 Jun 17, 2024

I found this color blending formula on a blog:

 

io38084075trh8_1-1718610502372.png

where a1, a2 are the values of alpha channel of image below and above(divided by 255), C1, C2 are the color channel values.

I was excited, but as I tried to dive further into the formula and do some experiments, I encountered some problems.

 

As the formula suggests, when a1 = 1 and a2 = 0.5, if you swap the color of two blending layers, as long as you keep the alpha channel value unchanged, the result is unchanged. However, when I do an experiment in AE, there are some subtle differences:

io38084075trh8_2-1718611963152.png

io38084075trh8_3-1718612051718.png

At first the alpha value of layer 1 is 1 (“不透明度" for "opacity"), the information showing the original color value. Now we change the alpha value of layer 1 to 50%:

io38084075trh8_4-1718612539107.pngio38084075trh8_5-1718612550894.png

then we swap the two layers and change layer2 value to 50%, and change layer1 value to 100%:

io38084075trh8_6-1718612644775.pngio38084075trh8_7-1718612652805.png

As you can see, the values of final results have subtle differences, but it shouldn't happen according to the color blending formula. Why is this?

TOPICS
FAQ
147
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
Community Expert ,
Jun 17, 2024 Jun 17, 2024

These are likely rounding errors created by using 8bit precision. Switch the project to 16bit int or 32bit float and they should be the same again.

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
New Here ,
Jun 18, 2024 Jun 18, 2024
LATEST

Thank you! That's very helpful. Now it's indeed same again.

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