Language: 
To browser these website, it's necessary to store cookies on your computer.
The cookies contain no personal information, they are required for program control.
  the storage of cookies while browsing this website, on Login and Register.

Author Topic:  GIMP 3.2.2 and our 8-bit Transparent PNGs  (Read 8 times)

0 Members and 0 Guests are viewing this topic.

Dolfo

« on: Today at 12:55:36 »
I feel like I’m having déjà vu. We’ve discussed this before (see here), but with the latest versions of GIMP, new (and old) challenges have surfaced.

GIMP is a powerful, free tool, and we are lucky to have it. However, handling our specific Daimonin assets requires a certain workflow to avoid breaking the graphics.

1. Import vs. Export

When you open a PNG in GIMP, remember that GIMP imports the file into its own internal format. It doesn't "save" back to PNG directly; you must use File -> Export As... to generate a PNG. Whether you keep the project in GIMP's native .xcf format is up to you, but for the game, only the export matters.

2. The Indexed Mode Problem (The Palette Shift Bug)

Most of our assets are 8-bit transparent PNGs, usually in Indexed Mode.
Unfortunately, the palette handling in Indexed Mode—which seemed partially fixed in 2.99—appears to be broken again in recent versions (like 3.0+).

The Bug: You can see it in action by going to Colors -> Colorize and activating the "Combined filter" checkbox. As you change colors, you’ll notice a "shifting" effect. The filter shifts the color palette by one index. Same bug is also triggered, when you export an indexed mode.
Since our engine relies on a specific color index for transparency masking, this shift breaks both the colors and the transparency alignment.

3. The Workaround: Use RGB Mode

Because of this bug, we are currently forced to avoid Indexed Mode when editing with GIMP 3.x.

    Before editing, go to Image -> Mode -> RGB.

    Yes, this increases the file size slightly compared to Indexed mode, but it ensures visual integrity.

4. Critical Export Settings

When exporting your work back to PNG, the settings in the export dialog are crucial. To keep our transparency working:

    CHECK: "Save color values for transparent pixels"

    CHECK: "Save background color"

    UNCHECK: Everything else.

Items like EXIF data, XMP, and other metadata significantly bloat the file size without adding any value to the game engine.

5. GIMP 3.0 Metadata (gAMA and cHRM)

GIMP 3.0+ exports include gAMA and cHRM chunks by default. While we could theoretically use metadata cleaners to strip these and save even more disk space and traffic, I currently don't have the capacity to integrate those tools into the pipeline.

Summary

Until the GIMP developers fix the palette shift bug in Indexed Mode, please convert to RGB for all (re)exports to PNG. This ensures our transparency masks stay intact and the colors don't bleed.

Hopefully, one day, GIMP will handle indexed palettes reliably again!
« Last Edit: Today at 13:01:41 by Dolfo »
Don't believe the shit, you hear in mainstream. Believe your own body. Your body is speaking always the true to you. But you need to understand your body. Hear to your body, not to your ego. And when body is calling to you: "Hey something is wrong!" find the reason(s) for that. Man in White don't go for that, they don't want to heal you. They want earn money and sell you medicine, you should take rest of your life. You are not the patient, you are their customer. Never forget this!

Tags:
 

Related Topics

  Subject / Started by Replies Last post
10 Replies
2392 Views
Last post 18, February 2006, 01:26:38
by Sherock
1 Replies
2347 Views
Last post 03, February 2009, 20:50:41
by subaru
Animated PNGs

Started by Mizza « 1 2 » Graphics

21 Replies
8169 Views
Last post 10, October 2009, 22:47:58
by Lippy
0 Replies
9274 Views
Last post 07, November 2014, 21:40:46
by michtoen
3 Replies
841 Views
Last post 27, February 2024, 17:26:39
by Dolfo