# Changeset 2125Tweet

Ignore:
Timestamp:
Dec 6, 2007, 11:46:38 PM (12 years ago)
Message:
• Show the results of serpentine Floyd-Steinberg on a grey 90% image.
• Fix the 4-0-2 output generation.
Location:
www/study
Files:
2 edited

Unmodified
Removed
• ## www/study/part3.html

 r2122

And here are the results of serpentine Floyd-Steinberg. Only a

The major problem with Floyd-Steinberg is the worm artifacts it creates. Here is an example of an image made of 90% grey dithered with standard Floyd-Steinberg and with serpentine Floyd-Steinberg. Most of the worm artifacts have disappeared or were highly reduced:

And here are the results of serpentine Floyd-Steinberg on Lenna. Only a very close look will show the differences with standard Floyd-Steinberg, but a few of the artifacts did disappear:

class="inline" alt="serpentine Floyd-Steinberg" /> class="inline" alt="serpentine Floyd-Steinberggradient" />

• ## www/study/study.py

 r2121 dest = Image((w, h), True) self.copyTo(dest, (-x, -y)) return dest def getZoom(self, z): (w, h) = self.size() dest = Image((w * z, h * z), True) for y in range(h): for x in range(w): rgb = self.getRgb(x, y) for j in range(z): for i in range(z): dest.setRgb(x * z + i, y * z + j, *rgb) return dest #test3xx(gradient256bw, ERROR_STAR, False).save("grad3-2-9.png") # Output 3-3-1: Floyd-Steinberg on grey 90% # Output 3-3-2: serpentine Floyd-Steinberg on grey 90% if chapter(3): tmp = Image((128, 128)) for y in range(128): for x in range(128): tmp.setGray(x, y, 0.90) test3xx(tmp, ERROR_FSTEIN, False).getZoom(2).save("out3-3-1.png") test3xx(tmp, ERROR_FSTEIN, True).getZoom(2).save("out3-3-2.png") ############################################################################## if chapter(4): return dest if chapter(4): test402(lenna256bw, ERROR_FSTEIN, False).save("out4-0-2.png") test402(gradient256bw, ERROR_FSTEIN, False).save("grad4-0-2.png")
Note: See TracChangeset for help on using the changeset viewer.