Menu

"TODO:" a-plenty

Library
2001-03-20
2001-04-18
  • William Entriken

    There's a lot of "TODO:"'s in there if you want to check into them, you can just toss me a function or two... make sure to tell me how to acredit you (hope you read the FDreadme).

     
    • Charles Conory

      Charles Conory - 2001-03-20

      how do you dither?

       
      • William Entriken

        you have 4 pixels and you want to reduce it down to 3:

        -------------------------
        |     |     |     |     |
        -------------------------
        to
        -------------------------
        |       |       |       |
        -------------------------

        each lower pixel has to use information of the its prior in the lease wasteful way possible.
        Each pixel uses information for all pixels in previous locations.

        The information is user porportionately, I hope this explains it:

        [1]      [2]      [3]      [4]
        -------------------------------------
        |00,FF,00|FF,00,00|FF,00,00|FF,FF,FF|
        -------------------------------------

        3 parts [1] 2 parts [2] 1 part  [3] 
        1 part  [2] 2 parts [3] 3 parts [3]
        -------------------------------------
        | 40,AF,00  | FF,00,00  | FF,AF,AF  |
        -------------------------------------

        hope that helps
        -- FullD

         
        • Charles Conory

          Charles Conory - 2001-03-20

          cool, thanx

           
        • Kelly Martin

          Kelly Martin - 2001-04-18

          actually, what you described is resampling, not dithering.

          dithering is when you use patterns of pixels drawn from a limited palette to approximate another image from a less limited palette.  e.g. taking full 24-bit color and reducing it to 256 color for 8-bit indexed color.  there are a lot of different dithering algorithms out there.  see, e.g., app/convert.c in gimp v1.3.x, or the ppmdither program from pnmutils.

          resampling is when you take an image at one size and regenerate it at another size either by stretching pixels out or blending them together.  the process of computing each new pixel from the source pixels that go into it is commonly called "interpolation", and there are also several possible algorithms.  the most common are nearest-neighbor, linear, and cubic (in order of increasing visual accuracy and decreasing speed).  see, e.g. the interpolation code in app/paint-funcs in gimp v1.3.x.

           
    • William Entriken

      i don't know how to do this... maybe you could give me a url or something???

       

Log in to post a comment.