blocktronics / moebius

Modern ANSI & ASCII Art Editor
https://blocktronics.github.io/moebius/
Apache License 2.0
734 stars 40 forks source link

utf8 export - wrong colors (light gray = white) #173

Open BlueMax opened 3 years ago

BlueMax commented 3 years ago

Hi, i think the light gray color is broken (it's actually white) when exporting as utf8. Tested on xfce and gnome terminal ('white on black' colors). The upper line is 'cat' output from Linux shell. The lower one is from Moebius.

lightgray

Looking at the escape codes you're using [0m (reset/remove all attributes) for light gray and [1m (Bold/Bright) for white. These are no actual color definitions indeed. It might work ok though for white but not for 'light gray' (actually it's in sync with 'white' when changing Terminal colors).

sblendorio commented 3 years ago

I tried #175 by exporting Utf8Ansi of this ANS file: https://www.dropbox.com/s/w6lkqinxk4inzde/BbcNews.ans?dl=0

...but the resulting utf8ans has lost the "bright white", replaced by "light gray": https://www.dropbox.com/s/0cp7g0wifrgceq9/BbcNews.utf8ans?dl=0

BlueMax commented 3 years ago

For me it looks like below. Tested on xfce4 terminal and termux (Android). What system/terminal are you on? Maybe 'bright white' is 'light gray' on your terminal by design. Check several color profiles/settings in your terminal. What happens without #175?

BbcNews

sblendorio commented 3 years ago

On the top, the result with #175 On the bottom, the result without #175 image It's strange because on the bottom, "sometimes" there is white and sometimes not. While on the top there is never... I use Ubuntu with its default terminal emulator.

BlueMax commented 3 years ago

The top one probably has a fixed (terminal) color palette with white set to gray. I have this option as well on my terminal. Only very few color palette templates are useful for ANSI art. Try to tweak the terminal or try xfce terminal.

The bottom one is broken as the current implementation without #175 doesn't define any color at all at some points. That's why it fluctuates between gray and white. If the terminal interpretation of this null color would be white the picture could be correct. But i haven't seen any terminal doing so. Maybe MacOS or some exotic system.

sblendorio commented 3 years ago

The strange thing is that, having white set on gray, the bottom case should never show white... or not?

sblendorio commented 3 years ago

I tried XFCE Terminal and it looks OK.

BlueMax commented 3 years ago

The strange thing is that, having white set on gray, the bottom case should never show white... or not?

Yes, i think so. Even though there might be two 'whites'. The 'cursor foreground' (that usually is gray though) and the fixed 16 colors palette 'white'. That's how you can tweak it in xfce terminal.

It might also help to take a more complex ANSI for testing. I mostly used this to test (just cat it in shell).

sblendorio commented 3 years ago

Why #175 is better than #174 ?

BlueMax commented 3 years ago

Some colors were wrong in xfce terminal. I cannot remember the exact result anymore though. I did change the values and compared it to the final ansi-utf8 file values with a Hex-Editor. And tested it with cat of course.