diff --git a/src/main/java/com/fragmenterworks/ffxivextract/helpers/ImageDecoding.java b/src/main/java/com/fragmenterworks/ffxivextract/helpers/ImageDecoding.java index 6eb4d58..20c2e73 100644 --- a/src/main/java/com/fragmenterworks/ffxivextract/helpers/ImageDecoding.java +++ b/src/main/java/com/fragmenterworks/ffxivextract/helpers/ImageDecoding.java @@ -48,9 +48,9 @@ public static BufferedImage decodeImage4444(final byte[] data, final int offset, for (int y = 0; y < targetHeight; y++) { for (int x = 0; x < targetWidth; x++) { final int pixel = buffer.getShort() & 0xffff; - final int r = ((pixel & 0xF)) * 16; + final int b = ((pixel & 0xF)) * 16; final int g = ((pixel & 0xF0) >> 4) * 16; - final int b = ((pixel & 0xF00) >> 8) * 16; + final int r = ((pixel & 0xF00) >> 8) * 16; final int a = ((pixel & 0xF000) >> 12) * 16; p += 2; img.setRGB(x, y, new Color(r, g, b, a).getRGB()); @@ -82,7 +82,7 @@ public static BufferedImage decodeImage4444split(final byte[] data, final int of for (int y = 0; y < targetHeight; y++) { for (int x = 0; x < targetWidth; x++) { final int pixel = buffer.getShort() & 0xffff; - final int r = 255 - ((pixel & 0xF)) * 16; + final int r = 255 - ((pixel & 0xF)) * 16; //potential bug: red and blue may be inverted final int g = 255 - ((pixel & 0xF0) >> 4) * 16; final int b = 255 - ((pixel & 0xF00) >> 8) * 16; final int a = 255 - ((pixel & 0xF000) >> 12) * 16; @@ -107,7 +107,7 @@ public static BufferedImage decodeImage4444split1channel(final byte[] data, fina buffer.position(offset); int p = 0; - final int r = 0; + final int r = 0; //potential bug: red and blue may be inverted final int g = 0; final int b = 0; switch (channel) { @@ -716,4 +716,4 @@ private ImageDecoding() throws InstantiationException { throw new InstantiationException(); } -} \ No newline at end of file +}