This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS: Controlling transparency of images in pipelines

Tool/software: TI-RTOS

Hi All,

I am using VSDK usecase to display two png images using VID2 pipeline. One of the image (smaller resolution image) needs to be overlayed on other background image.The smaller image has some part as transparent background. But when I try display, the transparent part is shown as black on top of background image.  So please guide me on how to control the transparancy for the smaller image.
and also I have tried to play with DISPC Overlay Optimization, DISPC Transparency Color Keys and color key transparency in chains_common.c file in ChainsCommon_SetDctrlConfig function but nothing helpful. Below is the snippet.

    ovlyPrms->deltaLinesPerPanel   = 0;
    ovlyPrms->alphaBlenderEnable   = 0;
    ovlyPrms->backGroundColor      = 0x0;
    ovlyPrms->colorKeyEnable       = 1;
    ovlyPrms->colorKeySel          = SYSTEM_DSS_DISPC_TRANS_COLOR_KEY_SRC;
    ovlyPrms->ovlyOptimization     = SYSTEM_DSS_DISPC_OVLY_FETCH_OPTIMIZED;
    ovlyPrms->transColorKey        = DRAW2D_TRANSPARENT_COLOR;

  • Nitin Kumar,

    If i understand, you want to make some portion of the foreground image transparent and show background image on that portion, correct? And this portion becomes black instead..
    Can you first check transparency color key? is it set to correct color??
    Also check the alpha value for this pipeline??

    If you could attached the image, it would be better to understand what is happening..

    Rgds,
    Brijesh
  • Thank you for instant reply Brijesh,

    Exactly, I want to make some portion of the foreground image transparent and show background image on that portion, which is becoming black.
    Transparency color is 0x0000 right now. What should be correct color here? I tried with 0x00FF and 0xFFFF but no change in behavior.
    Alpha value for this pipeline is 0xFF.

    Regards
  • Brijesh,
    Do we have any sample use-case to check this functionality or if you can give me some clue about what and where to try.

    Thanks
  • Nitin,

    Does the color of the portion of the image, that you want to make transparent match with the transparent color? If not, then transparency will not help. Instead, you should use alpha blending and set the alpha value of this region to be 0..

    Regards,
    Brijesh
  • Hi Brijesh,

    No, color is not matching with background image. I have tried making alphaBlenderEnable to 1 (common to both Venc ) and globalAlpha to 0 (for VID2 ppipeline) but observed no change in behavior.



    Thanks
  • Nithin,

    The Alpha blender uses alpha value of the top layer and then does alpha blending between two layers. So please check which layer is on the top and accordingly set the alpha value for this layer.
    Also transparency works by matching color, if the colors are not matching, transparency will do no change.
    So either you change the transparency in such way that it matches with the part of the image you want to make transparent, or you could use alpha blending, use the pixel based alpha blending such that each pixel has alpha value, for example ARGB format, then change the alpha value for those pixels, you want to make transparent to 0. Also make sure to make this layer, with the pixel alpha value, is on the top.

    Rgds,
    Brijesh