curiousdannii-testing / inform7-imported-bugs

0 stars 0 forks source link

[I7-1921] [Mantis 1957] IDE terp does not handle PNG images with gamma #163

Closed curiousdannii-testing closed 2 years ago

curiousdannii-testing commented 2 years ago

Reported by : curiousdannii

Description :

The IDE terp does not seem to handle PNG images with gamma correctly (or perhaps it does handle them correctly, and the glulx/glk standards should recommend not using gamma), with the image not blending in with the background.

http://imgur.com/yfRYor6

Steps to reproduce :

There is a room.

Include Simple Graphical Window by Emily Short.

Figure of map is the file "map-cove.png".

The background color of the graphics window is "007ADF".

After starting the virtual machine:
    now the currently shown picture is figure of map;
    now the current graphics drawing rule is the standard placement rule;

Additional information :

With this image: https://github.com/i7/counterfeit-monkey/blob/master/Counterfeit%20Monkey.materials/Figures/map-cove.png

And these extensions:

https://github.com/i7/extensions/blob/master/Dannii%20Willis/Alternative%20Startup%20Rules.i7x
https://github.com/i7/extensions/blob/master/Dannii%20Willis/Glk%20Events.i7x
https://github.com/i7/extensions/blob/master/Dannii%20Willis/Glk%20Object%20Recovery.i7x
https://github.com/i7/extensions/blob/master/Dannii%20Willis/Glulx%20Definitions.i7x
https://github.com/i7/extensions/blob/master/Emily%20Short/Glulx%20Entry%20Points.i7x
https://github.com/i7/extensions/blob/master/Emily%20Short/Glulx%20Text%20Effects.i7x
https://github.com/i7/extensions/blob/master/Emily%20Short/Simple%20Graphical%20Window.i7x
https://github.com/i7/extensions/blob/master/Jon%20Ingold/Flexible%20Windows.i7x

imported from: [Mantis 1957] IDE terp does not handle PNG images with gamma
  • status: Closed
  • resolution: Resolved
  • resolved: 2022-04-07T05:01:55+10:00
  • imported: 2022/01/10
curiousdannii-testing commented 2 years ago

557058:4c095ffd-6d6f-47ce-9e73-77c613347b86:

Comment by DavidK :
The problem was that the front-end was decoding all PNGs with gamma-correction (using a fixed screen gamma of 2.2) for both PNGs used in the UI and in the Glulx interpreters. Since no gamma correction was applied to colours set via Glulx, these wouldn't match decoded PNGs.

I've fixed this simply by not gamma-correcting PNGs loaded into the Glulx interpreters, which also matches the behaviour of Windows Glk.