Bitmap Converter(ST) format RLE16 with transparency

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Bitmap Converter(ST) format RLE16 with transparency

      Hello,

      I would like to convert a PNG with transparency into a RGB c file with transparency and compression RLE16.
      Is this possible?
      With the supplied Bitmap converter for STM32 (v.5.44) the default conversion which is made is to RLE32 but this gives me some memory problems on the visualization (due to RAM usage I guess).
      I've tried also with the command line but I got stuck when I have to set the color transparency as it keeps complaining on the values I try to set (I tried 0, 0xFF, 0xFF, etc. but none worked):

      Source Code

      1. C:\Users\Mark\Software>BmpCvtST.exe Sample_btn.png -convertintorgb -saveasSample_btn,1,12,1 -transparency,0xFF
      Can you give me a correct example for this kind of conversion (if this is possible) and one with the best palette which takes into account of the transparency?

      Thank you!

      Mark
    • Hi,

      You can convert an image into 'best palette with transparency', but you should note that only 1 bit will be used to store the transparency. This means semi-transparency is not possible. An image with 'best palette (and transparency)' can be saved as 8BPP or compressed as RLE8.

      You can use the following command to save the bitmap with best palette and transparency as RLE8:

      Source Code

      1. C:\Users\Mark\Software>BmpCvtST.exe Sample_btn.png -convertintotranspalette -saveasSample_btn,1,7

      The RLE16 format does not support transparency. If you want to have semi-transparency in your bitmap, you can save it in the A565 format, which uses 16 bits for color and 8 bits for transparency. The format is not compressed though.

      Use this command for A565:

      Source Code

      1. C:\Users\Mark\Software>BmpCvtST.exe Sample_btn.png -saveasSample_btn,1,27

      Best regards,
      Florian