Skip to content

Texture Unpacker: Gray sRGB PNG images display incorrect colors #968

@badlogic

Description

@badlogic

Summary

When unpacking a gray sRGB PNG using Spine's Texture Unpacker, the resulting image does not display the intended colors. Converting to color sRGB PNG before unpacking avoids the issue.

User Report

User: https://mail.google.com/mail/u/3/?ogbl#inbox/FMfcgzQfBZmZxXTRZKGnsJWDSNlbkgKg

The user reported that gray sRGB PNG images unpacked with Texture Unpacker don't show correct colors, but color sRGB PNGs work fine.

Technical Analysis

The issue appears to be in how the unpacker loads images:

Current unpacker image loading path:

  • SpineUnpacker → gdx TextureAtlas → Texture → Pixmap → stb_image
  • stb_image loads pixel data and ignores colorspace metadata

User image loading (in skeleton):

  • ImageMonitorTextureLoader → ImageLoader → javax.imageio
  • This path handles colorspace correctly

The unpacker uses libgdx's image loading which is less forgiving than the careful loading elsewhere in Spine. We expect atlas images to come from us, but this causes issues with gray sRGB images.

Reproduction

Need repro steps from the user to verify and test a fix.

Potential Fix

Load images differently for the unpacker to handle colorspace metadata properly, similar to how we load user images elsewhere in Spine.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions