Skip to content

RGBGFX makePalsAsSpecified does not account for transparent pixels #2048

Description

@Rangi42

Here's t1.png, all #0000FF with one transparent pixel:

Image
./rgbgfx -c "#0000FF,#FF0000" -o t1.2bpp -p t1.pal t1.png
error: Failed to fit tile colors [GB:00,00,31] in specified palettes
note: The following palette was specified:
      - [GB:31,00,00]
Conversion aborted after 1 error
$ ./rgbgfx -c "#0000FF,#FF0000,#FF00FF,#FFFFFF" -o t1.2bpp -p t1.pal t1.png
error: Failed to fit tile colors [GB:00,00,31] in specified palettes
note: The following palette was specified:
      - [GB:31,00,00; GB:31,00,31; GB:31,31,31]
Conversion aborted after 1 error

And here's t2.png, all #FF0000 with one transparent pixel:

Image
$ ./rgbgfx -c "#0000FF,#FF0000" -o t2.2bpp -p t2.pal t2.png
$ ./rgbgfx -c "#0000FF,#FF0000" -o t2.2bpp -p t2.pal -r 1 t2-rev.png
warning: Colors in the palette file do not match those specified with '-c'
Colors specified in the palette file:         ...versus with '-c':
[#0000ffff, #ff0000ff, #ffffff00, #ffffff00]  [#0000ffff, #ff0000ff, <none>   , <none>   ]
$ ./rgbgfx -c "#0000FF,#FF0000,#FF00FF,#FFFFFF" -o t2.2bpp -p t2.pal t2.png
$ ./rgbgfx -c "#0000FF,#FF0000,#FF00FF,#FFFFFF" -o t2.2bpp -p t2.pal -r 1 t2-rev.png
$ img2sixel t2-rev.png
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUnexpected behavior / crashes; to be fixed ASAP!rgbgfxThis affects RGBGFX

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions