Changes between Version 1 and Version 2 of libcaca/study/6
- Timestamp:
- 12/22/2009 09:22:36 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
libcaca/study/6
v1 v2 7 7 In some cases it is possible to perform three one-dimensional dithering operations instead of one three-dimensional one. Consider for instance the following palette: 8 8 9 [[Image(source:/web/trunk/ static/study/out/pat6-1-1.png,class="inline",alt="8-colour RGB palette")]]9 [[Image(source:/web/trunk/www/study/out/pat6-1-1.png,class="inline",alt="8-colour RGB palette")]] 10 10 11 11 It is made of the eight possible red/green/blue combinations made of 0 and 1 values: … … 19 19 Separate-space dithering works by splitting the image into three red, green and blue channels. Each of this channel is treated as a greyscale image that is then dithered to black and white using any dithering method seen previously. The resulting images are then treated again as three red, green and blue channels and recombined into the final image: 20 20 21 [[Image(source:/web/trunk/ static/study/fig6-1-7.png,class="matrix",alt="separate-space dithering")]]21 [[Image(source:/web/trunk/www/study/fig6-1-7.png,class="matrix",alt="separate-space dithering")]] 22 22 23 23 Here are the results with serpentine Floyd-Steinberg dithering applied to each channel. On the left, no colour correction, as The Gimp or Photoshop would do; on the right, gamma-corrected dithering: 24 24 25 [[Image(source:/web/trunk/ static/study/out/lena6-1-1.png,class="inline",alt="serpentine FS, 8 colours")]]26 [[Image(source:/web/trunk/ static/study/out/grad6-1-1.png,class="inline",alt="serpentine FS, 8 colours gradient")]]27 [[Image(source:/web/trunk/ static/study/out/lena6-1-2.png,class="inline",alt="serpentine FS, 8 colours, gamma-corrected")]]28 [[Image(source:/web/trunk/ static/study/out/grad6-1-2.png,class="inline",alt="serpentine FS, 8 colours, gamma-corrected gradient")]]25 [[Image(source:/web/trunk/www/study/out/lena6-1-1.png,class="inline",alt="serpentine FS, 8 colours")]] 26 [[Image(source:/web/trunk/www/study/out/grad6-1-1.png,class="inline",alt="serpentine FS, 8 colours gradient")]] 27 [[Image(source:/web/trunk/www/study/out/lena6-1-2.png,class="inline",alt="serpentine FS, 8 colours, gamma-corrected")]] 28 [[Image(source:/web/trunk/www/study/out/grad6-1-2.png,class="inline",alt="serpentine FS, 8 colours, gamma-corrected gradient")]] 29 29 30 30 == 6.2. Accounting for other dimensions == … … 34 34 Here is a palette that cannot be used in the same way: 35 35 36 [[Image(source:/web/trunk/ static/study/out/pat6-2-2.png,class="inline",alt="8-colour RGB palette")]]36 [[Image(source:/web/trunk/www/study/out/pat6-2-2.png,class="inline",alt="8-colour RGB palette")]] 37 37 38 38 As can be seen, it does not have the [0.5 0.5 0.5] grey colour, or the [1 0.5 0] orange colour, for instance, despite having other combinations of 0, 0.5 and 1 values: … … 46 46 The following examples show gamma-corrected Floyd-Steinberg using the above 16-colour palette and two different definitions of distance: the '''sum of absolute differences''' and the '''euclidian distance'''. The sum of absolute differences performs pretty poorly because it does not penalise wide disparities: 47 47 48 [[Image(source:/web/trunk/ static/study/out/lena6-2-1.png,class="inline",alt="Floyd-Steinberg, sum of absolute differences")]]49 [[Image(source:/web/trunk/ static/study/out/grad6-2-1.png,class="inline",alt="Floyd-Steinberg, sum of absolute differences gradient")]]50 [[Image(source:/web/trunk/ static/study/out/lena6-2-2.png,class="inline",alt="Floyd-Steinberg, euclidian distance")]]51 [[Image(source:/web/trunk/ static/study/out/grad6-2-2.png,class="inline",alt="Floyd-Steinberg, euclidian distance gradient")]]48 [[Image(source:/web/trunk/www/study/out/lena6-2-1.png,class="inline",alt="Floyd-Steinberg, sum of absolute differences")]] 49 [[Image(source:/web/trunk/www/study/out/grad6-2-1.png,class="inline",alt="Floyd-Steinberg, sum of absolute differences gradient")]] 50 [[Image(source:/web/trunk/www/study/out/lena6-2-2.png,class="inline",alt="Floyd-Steinberg, euclidian distance")]] 51 [[Image(source:/web/trunk/www/study/out/grad6-2-2.png,class="inline",alt="Floyd-Steinberg, euclidian distance gradient")]] 52 52 53 53 Distances can be computed in another space. For instance, the '''HSV space''' allows to give colour variations a smaller influence than brightness variations simply by changing the HSV cone’s height. On the left is spatial Floyd-Steinberg using the euclidian distance in an HSV cone of height 1 and base radius 1. On the right is the same distance within a cone of height 3 and base radius 1: 54 54 55 [[Image(source:/web/trunk/ static/study/out/lena6-2-3.png,class="inline",alt="Floyd-Steinberg, 1×1 HSV cone")]]56 [[Image(source:/web/trunk/ static/study/out/grad6-2-3.png,class="inline",alt="Floyd-Steinberg, 1×1 HSV cone gradient")]]57 [[Image(source:/web/trunk/ static/study/out/lena6-2-4.png,class="inline",alt="Floyd-Steinberg, 3×1 HSV cone")]]58 [[Image(source:/web/trunk/ static/study/out/grad6-2-4.png,class="inline",alt="Floyd-Steinberg, 3×1 HSV cone gradient")]]55 [[Image(source:/web/trunk/www/study/out/lena6-2-3.png,class="inline",alt="Floyd-Steinberg, 1×1 HSV cone")]] 56 [[Image(source:/web/trunk/www/study/out/grad6-2-3.png,class="inline",alt="Floyd-Steinberg, 1×1 HSV cone gradient")]] 57 [[Image(source:/web/trunk/www/study/out/lena6-2-4.png,class="inline",alt="Floyd-Steinberg, 3×1 HSV cone")]] 58 [[Image(source:/web/trunk/www/study/out/grad6-2-4.png,class="inline",alt="Floyd-Steinberg, 3×1 HSV cone gradient")]] 59 59 60 60 == 6.3. Reducing visual artifacts == … … 69 69 All patterns visually blend to the same shade, but the last one is the most visually appealing: 70 70 71 [[Image(source:/web/trunk/ static/study/out/pat6-2-1.png,class="inline",alt="3 ways to dither the same colour")]]71 [[Image(source:/web/trunk/www/study/out/pat6-2-1.png,class="inline",alt="3 ways to dither the same colour")]] 72 72 73 73 Shaked, Arad, Fitzhugh and Sobel introduce the '''minimum brightness variation criterion''' (MBVC), stating that in order to reduce halftone noise, the halftone set which should be used to render the desired colour should be the one whose brightness variation is minimal ![25]. Similarly, Klassen ''et al.'' suggest the selection of low-contrast colour combiation wherever possible ![24]. … … 79 79 The images below shows the result using our now well-known “lines” tile list, using respectively the 8-colour palette and the 16-colour palette: 80 80 81 [[Image(source:/web/trunk/ static/study/out/lena6-4-1.png,class="inline",alt="8-colour sub-block error diffusion")]]82 [[Image(source:/web/trunk/ static/study/out/grad6-4-1.png,class="inline",alt="8-colour sub-block error diffusion gradient")]]83 [[Image(source:/web/trunk/ static/study/out/lena6-4-2.png,class="inline",alt="16-colour sub-block error diffusion")]]84 [[Image(source:/web/trunk/ static/study/out/grad6-4-2.png,class="inline",alt="16-colour sub-block error diffusion gradient")]]81 [[Image(source:/web/trunk/www/study/out/lena6-4-1.png,class="inline",alt="8-colour sub-block error diffusion")]] 82 [[Image(source:/web/trunk/www/study/out/grad6-4-1.png,class="inline",alt="8-colour sub-block error diffusion gradient")]] 83 [[Image(source:/web/trunk/www/study/out/lena6-4-2.png,class="inline",alt="16-colour sub-block error diffusion")]] 84 [[Image(source:/web/trunk/www/study/out/grad6-4-2.png,class="inline",alt="16-colour sub-block error diffusion gradient")]] 85 85 86 86 Speed is starting to become a problematic issue. A 16-colour palette can generate 65,536 unique 2×2 blocks. Exhaustive search to determine the best tile is no longer realistic, and we need to find better ways to find the best matching block.