Richard Stallman writes: > > * Use a PBM form of the same image. How hard is that? Does it have > > drawbacks? > > You mean, if a package provides only XPM we should calculate a PBM/XBM > image from that XPM via manipulation of the data strings? > > I was thinking that the programmer would supply the image in PBM > format. This could be in addition to XPM, or instead of XPM. How > hard is that? That's easy. However, my misunderstanding caused me to read a bit about the PBM format. I discovered that my Emacs supports PPM and PGM, too. The three related image formats PBM (black & white), PGM (grayscale) and PPM (colour) are supposed to be intermediate formats for image conversion. Well, it should be straightforward to convert XPM to PPM. I already started to write a small library. I don't know anything about Emacs' internals. Does an Emacs that supports images always support colours, too? Does an Emacs that supports PBM alway support PPM, too? If this is so and if I am not missing something this would mean, that every Emacs able to display images could display XPMs via some Lisp. > It is a pity that Emacs does not provide any means to create and > change an image in the image cache directly. This could make this task > (and some others) much easier. > > I guess so. It would be nice if all image formats (or at least more > of them) supported getting the image from Lisp data rather than from > a file. Does someone want to work on that? [...] Perhaps you like the approach that I chose in my unfinished code (attached)? For example: (let ((pic (make-pixmap 16 16 'colour '(0 0 0)))) (experimental!-draw-line pic 15 0 0 15 '(255 0 0)) (experimental!-draw-line pic 0 0 15 15 '(0 0 255)) (insert-image (experimental!-pixmap-to-image pic :ascent 'center))) -- Oliver