XTX-Extractor icon indicating copy to clipboard operation
XTX-Extractor copied to clipboard

Warning: colors might mess up!!

Open AnalogMan151 opened this issue 7 years ago • 4 comments

I'm using this tool to convert XTX files to DDS, edit the image, then reconvert back to XTX again however I am experiencing exactly what the error states, that colors are messed up. I am using Adobe Photoshop with a DDS plugin. Here is an example of the conversion to and from DDS:

XTX to DDS

// ----- NvTextureHeader Info ----- 
  imageSize       = 906240
  alignment       = 512
  width           = 400
  height          = 300
  depth           = 1
  target          = 1
  format          = NVN_FORMAT_RGBA8
  numMips         = 6
  sliceSize       = 906240

  bits per pixel  = 32
  bytes per pixel = 4

Processing 5 mipmaps:
1: 200x150
0x96000
2: 100x75
0xca000
3: 50x37
0xd8000
4: 25x18
0xdc000
5: 12x9
0xdd000

Altered DDS to XTX:

// ----- NvTextureHeader Info ----- 
  imageSize       = 480000
  alignment       = 512
  width           = 400
  height          = 300
  depth           = 1
  target          = 1
  format          = NVN_FORMAT_RGBA8
  numMips         = 1
  sliceSize       = 480000

  bits per pixel  = 32
  bytes per pixel = 4

Warning: colors might mess up!!

I was wondering if you had any recommended save settings to help prevent this or know why this can occur?

AnalogMan151 avatar Sep 19 '18 06:09 AnalogMan151

Actually, converting to DDS, then immediately back to XTX also produces a messed up image, so it looks like it's not just my edits. The official Nintendo tool can convert TGA files to XTX as well with a parameter to declare how many mipmaps there are. Would it be possible to add TGA support too?

AnalogMan151 avatar Sep 19 '18 23:09 AnalogMan151

I'm also having issues with messed up colors. I converted a PNG to DDS, and I'm sure the DDS is fine because converting back to PNG was fine. Then, when converting to XTX, the colors are messed up

niemasd avatar Sep 22 '18 00:09 niemasd

The warning means you are using ARGB8 instead of ABGR8.

aboood40091 avatar Sep 22 '18 01:09 aboood40091

I don't see any flags to specify which type. The original XTX file is stored as RGB8, extracts to a RGB8 DDS, then (without edits) reconverts back into an invalid XTX. Does this tool only compile back into ABGR8 and that's the issue? It doesn't support RGB8?

AnalogMan151 avatar Sep 22 '18 03:09 AnalogMan151