How to draw sprites using DMA2D with transparency using stm32?
Neither of the pixel formats you've used so far (RGB565 and RGB888) have Alpha values, so the DMA2D will not treat any of them as transparent. A pixel value of 0 is black, not transparent, so black is what you see.
If you want individual pixels to be transparent when you're manipulating them with the DMA2D 'ChromeArt' accelerator then you need to use a pixel format which includes an Alpha value like ARGB1555, ARGB8888, etc - and set the Alpha value to 0 for the pixels which you want to be transparent.
Your other option is to use the 'Color Keying' feature of the LTDC Display controller - this does not require your pixel format to have an Alpha value, but does require that you use 2 framebuffers in RAM - one for the foreground layer (where you'll place your sprite(s) and another for the background layer.
To do this you would choose a particular color value as the transparent pixel value, and configure the LTDC_L1CKCR (Foreground Layer Color Keying)  register for that color.
Then when the LTDC module builds the 'final' image by merging the foreground layer onto the background layer it'll ignore all foreground pixels with that color and show the background pixels instead.