Re: MMX speedup for Floyd Steinberg error diffusion



Phil, you're absolutely right, and that's why "doing it right" is even
harder than you're showing here:

There is this color quantizer/ditherer program called scolorq which
uses some highly advanced techniques with floating point precision. I
tried that out and it took an astonishing amount of time for a single
frame ( I let it run for 3 minutes before giving up in disgust ).
Turns out it has 5 deep nested loops. Some site online shows pretty
impressive results for reduction to 16 color images. Perhaps the
algorithm doesnt scale to 256 colors.

Ill try out your approach with palette lists and see how it goes...

The color space should probably be gamma-adjusted, and the error terms
should be calculated in a linear space, otherwise the error diffusion
terms won't add up properly.

OTOH, at the time we start to worry about stuff like this, 8-bit GIF
images with palettized colors shouldn't be considered for the job,
right? :-)

It seems to be a tribute to the human eye that even when the image
information is reduced by a factor of 2^16, the artifacts of
palettization and dithering are hardly noticed. Combined with the fact
that many input videos are blocky due to video compression, and the
fact that each frame appears for a fraction of a second, minor errors
in error diffusion ( he he ) are not noticed.

BTW This whole thing could be avoided if browser vendors implemented
GIF decoding exactly according to the standard. Then it would be
possible to have animations where a number of frames are rendered
instantaneously (with 0 frame duration) and we could have true true-
color GIFs.

Vivek

.



Relevant Pages

  • Reading all frames and information of GIF [solution]
    ... Well, I've been bussy with a gif loader, because I needed all the frames. ... For each frame, the function addFrame(Image image, ... private static final String NODEPATH_HEIGHT = ... int imageHeight = Integer.parseInt(findValueWithPath(streamRoot, ...
    (comp.lang.java.programmer)
  • Re: Timing of animated GIFs
    ... The last frame of my GIF was set to 10 seconds, ... that I could advance the PowerPoint slide with the last part of the GIF ... Fixing PowerPoint Annoyances http://www.oreilly.com/catalog/powerpointannoy/ ... The GIF starts to animate as soon as it hits the screen, ...
    (microsoft.public.powerpoint)
  • Re: Animated GIFs
    ... > palette trying to span the colour cube uniformly. ... > dithering instead of error diffusion - that would make sure that equal ... > colours are represented in the same way in each frame. ... >> Is there a package that allows image manipulation on all the frames at ...
    (comp.sys.acorn.apps)
  • Rendering animated GIFs
    ... I'm trying to display an animated GIF (GIF89a) using GDI. ... or 1 - don't remove the current frame and simply draw the next one over it ... works for the linked GIF and uses a zero-based 'disposal method' field? ...
    (microsoft.public.win32.programmer.gdi)
  • Re: How to delete from palette
    ... In fact I initially stored on the Delphi "template" palette a frame with the ... Delphi kept saying that another component existed with the same name... ...
    (comp.lang.pascal.delphi.misc)