You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gfx4snes is not converting this PNG file correctly.
Here is the command I am using to convert the file:
gfx4snes -R -s 8 -u 4 -p -t png -i font-2bpp.png
and this is output of a simple Hello World program using consoleInitText() and consoleDrawText().
I also see the same corruption when converting the file to a 4bpp tile format.
The PNG file was created with GIMP, it contains 2 colours in the colourmap and was exported to PNG using the automatic pixel format option.
Loading the PNG file in Aseprite and saving it to a new file causes gfx4snes to work as expected.
This is the output of the same Hello World program using the png file from Aseprite:
Comparing the two png files lead me to believe gfx4snes was unable to correctly load PNG files with bit-depth of 1.
ExifTool Version Number : 12.76
File Name : font-2bpp-gimp.png
Directory : .
File Size : 542 bytes
File Modification Date/Time : 2024:04:05 17:14:22+10:00
File Access Date/Time : 2024:04:05 17:14:22+10:00
File Inode Change Date/Time : 2024:04:05 17:38:06+10:00
File Permissions : -r--r--r--
File Type : PNG
File Type Extension : png
MIME Type : image/png
Image Width : 128
Image Height : 48
Bit Depth : 1
Color Type : Palette
Compression : Deflate/Inflate
Filter : Adaptive
Interlace : Noninterlaced
Palette : (Binary data 6 bytes, use -b option to extract)
Image Size : 128x48
Megapixels : 0.006
ExifTool Version Number : 12.76
File Name : font-2bpp-aseprite.png
Directory : .
File Size : 773 bytes
File Modification Date/Time : 2024:04:05 18:20:00+10:00
File Access Date/Time : 2024:04:05 18:20:00+10:00
File Inode Change Date/Time : 2024:04:05 18:20:00+10:00
File Permissions : -r--r--r--
File Type : PNG
File Type Extension : png
MIME Type : image/png
Image Width : 128
Image Height : 48
Bit Depth : 8
Color Type : Palette
Compression : Deflate/Inflate
Filter : Adaptive
Interlace : Noninterlaced
SRGB Rendering : Perceptual
Palette : (Binary data 6 bytes, use -b option to extract)
Image Size : 128x48
Megapixels : 0.006
The following patch fixes gfx4snes for my PNG file. I do not know why pngstate.decoder.color_convert is 0, so I'm writing a bug report instead of submitting a PR.
diff --git a/tools/gfx4snes/src/images.c b/tools/gfx4snes/src/images.c
index c1a1029e..137d2275 100644
--- a/tools/gfx4snes/src/images.c+++ b/tools/gfx4snes/src/images.c@@ -106,8 +106,7 @@ void image_load_png(const char *filename, t_image *img, bool isquiet)
// optionally customize the state
lodepng_state_init(&pngstate);
- // no conversion of color (to keep palette mode) - pngstate.decoder.color_convert = 0;+ pngstate.decoder.color_convert = true;
// always in 8 bits and palette mode
pngstate.info_raw.colortype=LCT_PALETTE;
PVSnesLib version: 4.2.0
OS: Linux x64
The text was updated successfully, but these errors were encountered:
gfx4snes is not converting this PNG file correctly.
Here is the command I am using to convert the file:
and this is output of a simple Hello World program using
consoleInitText()
andconsoleDrawText()
.I also see the same corruption when converting the file to a 4bpp tile format.
The PNG file was created with GIMP, it contains 2 colours in the colourmap and was exported to PNG using the automatic pixel format option.
Loading the PNG file in Aseprite and saving it to a new file causes gfx4snes to work as expected.
This is the output of the same Hello World program using the png file from Aseprite:
Comparing the two png files lead me to believe gfx4snes was unable to correctly load PNG files with bit-depth of 1.
The following patch fixes gfx4snes for my PNG file. I do not know why
pngstate.decoder.color_convert
is 0, so I'm writing a bug report instead of submitting a PR.PVSnesLib version: 4.2.0
OS: Linux x64
The text was updated successfully, but these errors were encountered: