Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown ILBM IFF Format - Colors Wrong #6

Open
MissionCyberSpace opened this issue Nov 14, 2023 · 4 comments
Open

Unknown ILBM IFF Format - Colors Wrong #6

MissionCyberSpace opened this issue Nov 14, 2023 · 4 comments

Comments

@MissionCyberSpace
Copy link

So, I tried this ilbm javascript web program, and it opened many IFF images. However it was unable to open a specific ILBM IFF I have. So, I edited the iff.js file. Now it opens the IFF file but the image is noisy and the colors are completely wrong.

I have included an image of how it is displayed in the js application which I edited to actually open it, and how it should look like.
The IFF image is included with the edited application.

image

The edited ilbm.js application.
WorkingCopy.zip

@wiesmann
Copy link
Owner

Would you mind telling me how/where you change the code?

@MissionCyberSpace
Copy link
Author

Would you mind telling me how/where you change the code?

If I recall, I specifically remember changing

/* Not color map, must be absolute 24 bits RGB */
  if (iff.bitplanes == 16) {
    return resolveRGB24Pixel(value);
  }

And

/**
 * Resolves a RGB24 encoded value into a correct color.
 */
function resolveRGB24Pixel(value) {
  // fixed by mrupp for his TAWS project
var red = (value & 0x7C00) >> 7;
  var green = (value & 0x03E0) >> 2;
  var blue = (value & 0x001F) << 3;
  return [red, green, blue, 255];
}

I think that's all I changed, apart from setting the path name to the IFF in the HTML.

@wiesmann
Copy link
Owner

I will have a look when I have time, I never seen a 16 bits / pixel ilbm image.

@MissionCyberSpace
Copy link
Author

Neither have I, hehe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants