I'm trying to use w3m to display image in emacs, however I saw that for some reasons it's unable to display correctly the png files that have a non-rgb colormap. Here is an example:

enter image description here

All the images are png: - The first picture has been manually created using gimp, and file gives me: 8-bit/color RGBA, non-interlaced. This image is nicely displayed. - The second picture was generated by an export of a latex formula using org-mode, and file gives me 4-bit colormap, non-interlaced, but you can also generate this kind of picture using gimp and setting the mode to indexed colors. This image has a white background (why ?), and the conversion is very bad, like if imagemagick was used without any parameters to deal with the alpha channel - The third one is like the second one, but exported into gimp, and saved directly without changing anything, and file gives me the same thing: 4-bit colormap, non-interlaced. The question is why is the background color different? - The last one is the same one as the last one, but saved from gimp using mode RGB, file gives me 8-bit/color RGBA, non-interlaced.

I though at the beginning that the problem was concerning imagemagick... But I tried to replace convert in the path with a custom script that would write a new line in a log file during call, and this script is called only once the first time I load w3m, and the parameters given let me think that it's only to check if imagemagick supports PNG, but this function was not called later.

So here is my question: 1) why are 4-bit colormap (and maybe others) a problem? 2) how could I have a nice display for them?

Thank you!

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.