Bitmap converter

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

    • Bitmap converter


      I want to set a transparent color (#FF00FF, pink color) which I can use as a color palette so this can be filtered out when drawing the image on screen
      I use Bitmap converter v 5.46a

      I start from a png ( see attachment) with a pink background.
      My final result is that the image is not centered and not completely visible in the container (see attachment, blue image).
      If I don't use transparency the image is centered but I still see the pink color as BG which I want to get rid off.

      The steps I do are the following:

      - open the image (P000.png - see attachment)
      - convert to > best palette
      - set transparency color > FF00FF (pink)
      - save as .c file, true color with alpha

      The output of the c-file (see attachment, P00.txt) looks broken

      1 - before and after the value of the color bit, there is a comma

      C Source Code

      1. static GUI_CONST_STORAGE unsigned char _acP00[] = {
      2. , 0xF00,
      3. , 0xF00,
      4. , 0x1F00,
      5. , 0xF00,
      6. , 0xF00,
      7. , 0x1F00,
      8. , 0x1F00,
      9. , 0x1F00,

      2 - &_PalP00 // Pointer to palette --> also missing comma

      C Source Code

      2. 80, // xSize
      3. 80, // ySize
      4. 320, // BytesPerLine
      5. 32, // BitsPerPixel
      6. _acP00, // Pointer to picture data (indices)
      7. &_PalP00 // Pointer to palette
      8. GUI_DRAW_BMP8888
      9. };

      Is there a wrong step above or is this a bug in the bitmap converter?

      Thanks in advance.
      • P000.png

        4.49 kB, 80×80, viewed 36 times
      • steps.png

        70.07 kB, 916×1,232, viewed 45 times
      • P00.txt

        (4.07 kB, downloaded 39 times, last: )

      The post was edited 3 times, last by Pieter Eggermont ().

    • Hi Pieter,

      The issue of incorrect output has been fixed since v5.50.

      You should note, when converting to best palette, the bitmap will be palette-based. This means, you will have to save the bitmap in an indexed format, such as 8bpp or RLE8. Otherwise, if choosing the "True color with alpha" format, the bitmap will be saved in the 32bpp format without a palette.

      Best regards,