# Changeset 1937 for wwwTweet

Ignore:
Timestamp:
Nov 11, 2007, 10:16:15 PM (13 years ago)
Message:
• Burkes dithering.
Location:
www/study
Files:
2 edited

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

 r1936

Finally, Stucki dithering is a slight variation of Jarvis-Judice-Ninke dithering:

Stucki dithering is a slight variation of Jarvis-Judice-Ninke dithering:

Burkes dithering is yet another variation:

• ## www/study/study.py

 r1936 # Output 3-2-3: Stucki # TODO: merge with Jarvis, Judice and Ninke # TODO: merge with Jarvis-Judice-Ninke def test323(src, name): (w, h) = src.size() test323(lenna256bw, "out3-2-3.png") test323(gradient256bw, "grad3-2-3.png") # Output 3-2-4: Burkes # TODO: merge with Jarvis-Judice-Ninke and Stucki def test324(src, name): (w, h) = src.size() dest = Image((w, h)) ep = [0.] * (w + 4) for y in range(h): ey = [0.] * (w + 4) ex = 0 ex2 = 0 for x in range(w): c = src.getGray(x, y) + ex + ep[x + 2] d = c > 0.5 dest.setGray(x, y, d) error = c - d ex = ex2 + error * 8. / 32. ex2 = error * 4. / 32. ey[x] += error * 2. / 32. ey[x + 1] += error * 4. / 32. ey[x + 2] += error * 8. / 32. ey[x + 3] += error * 4. / 32. ey[x + 4] += error * 2. / 32. ep = ey dest.writePng(name) test324(lenna256bw, "out3-2-4.png") test324(gradient256bw, "grad3-2-4.png") ##############################################################################
Note: See TracChangeset for help on using the changeset viewer.