cancel
Showing results for 
Search instead for 
Did you mean: 

DMA2D: adding transparency to a bitmap - is it possible? ((A)RGB + A8 blending)

TDJ
Senior III

I have ARGB bitmap image and I would like to blur its edges by applying A8 mask.

Is it possible to do it with DMA2D Chrom-Art? I cannot figure it out.

Note: it is not the same as blending masked solid color with background, e.g. to draw anti-aliased font.

In another words, I want to replace (or mix) my bitmap alpha channel with A8 mask bits without changing RGB values.

3 REPLIES 3
KDJEM.1
ST Employee

Hello @TJast​,

Could you please provide more details, such as the MCU you are using.

For example with STM32F7, the DMA2D has four operating modes:

  • Register-to-memory for rectangle filling operation,
  • Memory-to memory for 2D memory copy operations,
  • Memory to memory with pixel format conversion for bitmap drawing with format conversion,
  • Memory to memory with pixel format conversion and blending for bitmap or text drawing with transparency.

For more explanation, I advise you take a look at this presentation.

Thank you.

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

TDJ
Senior III

@KDJEM.1​ Thank you for your answer. The exact MCU I am dealing with is STM32F769NI.

I am aware of the four supported CR modes and three AM (alpha modes). However, it seems to that none of the possible combinations allows to accomplish what I am looking for, that is, combining RGB bitmap with another bitmap containing alpha A8 bytes only WITHOUT blending (A+ARGB->ARGB), just replacing one alpha bitmap value for another.

TDJ
Senior III

@KDJEM.1​ I know the answer- it is not possible as it would require two "foregrounds".