Recent

Author Topic: ResampleFilter leads to black image  (Read 1616 times)

CorBee

  • New Member
  • *
  • Posts: 32
Re: ResampleFilter leads to black image
« Reply #15 on: November 07, 2022, 07:36:34 am »
The weird thing is that I never set the Alpha to zero ... must be happening when loading into the TFPmemoryImage or so.
But it is solved. Would have been easier if the values of pixels were not set to zero depending on the alpha ...
 

circular

  • Hero Member
  • *****
  • Posts: 4194
    • Personal webpage
Re: ResampleFilter leads to black image
« Reply #16 on: November 09, 2022, 08:45:09 pm »
Strange indeed.

Sure it would have been easier. Though there are reasons why that's the case. The weight of a pixel when blending is its alpha value. For example if you mix blue with opacity 100% and black with opacity 1% together, it basically stays blue. So values are multiplied by alpha, and if alpha is zero, the result is zero. The resulting image is not really black, it is fully transparent.
Conscience is the debugger of the mind

 

TinyPortal © 2005-2018