Search code examples
antialiasingalphablendingdisplay

Without alpha path how to decrease edge effect while paste icon


I got a RGB332 LCD and a poor MCU to drive it . The MCU do not have a hardware accelerator nor do RGB332 display support an alpha path.

So I used the color "black" as a "alpha color" to deal with icon paste work.Which means I fill the icon color data to background buffer while the data is not black.

The problem I meet is that the icon showed it's own antialiased edge while the background is not black. And the "antialiased edge" just makes an edge effect from the background.

Is there any way to deal with the situation ?


Solution

  • The main problem is that I don't have "Layer" and "Alpha" to do the PS-like merge work.

    But the Icons are Pasted to a Frame buffer one by one.

    So my solution is :

    1. When each icon is being pasted,I could decide the front/background, which means I could detect the "antialiased edge" of the icons just like I have "layers".
    2. After I find the antialiased edges ,I filled the pixels with the middle color of the front/background.
    3. The LCD is RGB332,and the middle color calculation is just filling the edge with 75% background color + 25% front color. If the icon color is carefully designed, you don't even need a float calculation .

    The work maybe not that effective ,but really solved my problem.