Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!nstn.ns.ca!news.cs.indiana.edu!samsung!sdd.hp.com!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!pacbell.com!ucsd!dog.ee.lbl.gov!pasteur!ICSI.Berkeley.EDU!gilge From: gilge@ICSI.Berkeley.EDU (Michael Gilge) Newsgroups: comp.windows.x Subject: COLOR image sequences under X Keywords: colormap, moving images Message-ID: <11371@pasteur.Berkeley.EDU> Date: 23 Feb 91 01:40:42 GMT Sender: news@pasteur.Berkeley.EDU Reply-To: gilge@ICSI.Berkeley.EDU (Michael Gilge) Organization: International Computer Science Institute, Berkeley, CA Lines: 36 I am currently writing a program that displays moving video in a X-window. For black and white everything works fine: Using a SPARC- station with 8-bit screen, I can display a typical videophone sequence (352 pixel/line, 288 lines) in real-time (30 frames/sec.). Now I am extending the program to support color. Thanks to the colormap and a clustering scheme, 24bit RGB images can be compressed to the 256 or less most prominent colors for each frame. In order to animate the images on the screen, not only the pixels but now also the colormap has to be updated 30 times a second. So far I followed two approaches: - I updated the colormap and the actual image sequencially. During the interval after the colormap has been updated but the new frame is not yet copied, one can see a very annoying flash on the screen. This is caused by the limited speed of the hardware and the fact that the image is displayed in false colors for a moment. - For the second approach, I used only half of the available colors (<128) for each frame in order to exploit kind of a double buffering technique: The colors for the next frame to be displayed are written to an area of the colormap, which is not used by the current image. After that the image is updated and immediately displayed in correct colors. Unexpectedly there is still a flickering effect, especially in the upper half of the image beeing displayed. Has anybody experience with dynamically changing colormaps or color animation on 8-bit displays? I tried all tricks I know of, e.g. XFlush, XSync. I can stop the animation at any time and all colors are right. The effect is strictly dynamic and changes when I vary the frame rates. I have a feeling that there is some kind of conflict between the screen refresh and the X-server update of the colormap. Your suggestions are greatly appreciated....... Michael Gilge, International Computer Science Institute, Berkeley, Sunny Calif.