Skip to main content
TDJ
Senior III
December 7, 2022
Question

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

  • December 7, 2022
  • 3 replies
  • 1602 views

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.

This topic has been closed for replies.

3 replies

KDJEM.1
ST Technical Moderator
December 16, 2022

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 "Best answer" on the reply which solved your issue or answered your question.
TDJ
TDJAuthor
Senior III
December 16, 2022

@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
TDJAuthor
Senior III
December 29, 2022

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