Loading ...
Sorry, an error occurred while loading the content.
 

Re: [ploticus] corrupted symbols in scatterplots

Expand Messages
  • Stephen C. Grubb
    Andrew, I believe this is caused by aliasing - a computer graphics term that refers to error/distortion introduced by rasterization or numeric rounding. It
    Message 1 of 11 , Aug 1, 2005
      Andrew, I believe this is caused by "aliasing" - a computer graphics term
      that refers to error/distortion introduced by rasterization or numeric
      rounding. It is most noticable with small objects such as your data
      points, and lines that approach (but are not quite) horizontal or
      vertical.

      Ploticus generates vector graphics, which must be rasterized to get them
      into PNG/GIF. Then when PNG/GIF are rendered by the browser there may be
      another round of rasterization that might not sync with the first round.

      Aliasing is less of a problem with vector-based output formats such as SVG
      and EPS.

      Steve

      On Fri, 29 Jul 2005, Andrew Schulman wrote:

      > I'm creating some scatterplots with ploticus 2.31. As you can see in the
      > screenshot at http://home.comcast.net/~andrex/bugz/ploticus.png, some of
      > the plotting symbols get corrupted. Look, for example, at the entire rows
      > at y=7 and 7.4. Other rows come out fine. I get the same result if I
      > output to GIF.
      >
      > The script I used to create this image is at
      > http://home.comcast.net/~andrex/bugz/ploticus.plo.
      >
      > Does anyone have any idea what's causing this, or how to work around it?
      >
      > Thanks,
      > Andrew.
      >
      >
      >
      >
      >
      >
      > Yahoo! Groups Links
      >
      >
      >
      >
      >
      >
      >


      Stephen C. Grubb
      Scientific Software Engineer, The Jackson Laboratory
      600 Main Street Bar Harbor, Maine 04609 USA
    • Andrew Schulman
      ... OK. I looked at SVG and EPS output, and as you say they look fine. So then this is the fault of libpng and/or libgd? It s strange that the PNG and GIF
      Message 2 of 11 , Aug 1, 2005
        > Andrew, I believe this is caused by "aliasing" - a computer graphics term
        > that refers to error/distortion introduced by rasterization or numeric
        > rounding. It is most noticable with small objects such as your data
        > points, and lines that approach (but are not quite) horizontal or
        > vertical.
        >
        > Ploticus generates vector graphics, which must be rasterized to get them
        > into PNG/GIF. Then when PNG/GIF are rendered by the browser there may be
        > another round of rasterization that might not sync with the first round.

        OK. I looked at SVG and EPS output, and as you say they look fine.

        So then this is the fault of libpng and/or libgd? It's strange that the
        PNG and GIF outputs show exactly the same corruption-- maybe they're
        using the same rasterization algorithm. It's also disappointing,
        because after all these are diamonds, with sides sloped at 45 degrees--
        they should be easy to get right.
      • Stephen C. Grubb
        Andrew, ploticus uses libgd to generate both PNG and GIF. I took a quick look at the GD docs (www.boutell.com/gd) and it appears that recent versions of GD do
        Message 3 of 11 , Aug 1, 2005
          Andrew,

          ploticus uses libgd to generate both PNG and GIF. I took a quick look at
          the GD docs (www.boutell.com/gd) and it appears that recent versions of GD
          do include antialiased line drawing capability. I'm not sure what would be
          involved in getting ploticus to use that, and if it would be worth it, but
          I'll make a note to look into it.

          Even with simple figures such as diamonds, aliasing can cause noticable
          distortion. PNG and GIF are rasterized to 100 dots per inch (?).. your
          data points are maybe 1/10 inch in diameter.. this gives you only a small
          number dots to work with. If you were to take a piece of graph paper and
          draw several diamonds (4 lines) 10 units in diameter in completely
          arbitrary fractional locations, then rasterize them (fill in the squares
          that the line passes thru using some consistent rule), you will likely see
          some similar irregularities.

          -Steve




          On Mon, 1 Aug 2005, Andrew Schulman wrote:

          >
          > > Andrew, I believe this is caused by "aliasing" - a computer graphics term
          > > that refers to error/distortion introduced by rasterization or numeric
          > > rounding. It is most noticable with small objects such as your data
          > > points, and lines that approach (but are not quite) horizontal or
          > > vertical.
          > >
          > > Ploticus generates vector graphics, which must be rasterized to get them
          > > into PNG/GIF. Then when PNG/GIF are rendered by the browser there may be
          > > another round of rasterization that might not sync with the first round.
          >
          > OK. I looked at SVG and EPS output, and as you say they look fine.
          >
          > So then this is the fault of libpng and/or libgd? It's strange that the
          > PNG and GIF outputs show exactly the same corruption-- maybe they're
          > using the same rasterization algorithm. It's also disappointing,
          > because after all these are diamonds, with sides sloped at 45 degrees--
          > they should be easy to get right.
          >
          >
          >
          >
          >
          > Yahoo! Groups Links
          >
          >
          >
          >
          >
          >
          >
          >


          Stephen C. Grubb
          Scientific Software Engineer, The Jackson Laboratory
          600 Main Street Bar Harbor, Maine 04609 USA
        • Andrew Schulman
          ... OK-- I see. In this case I d rather snap to grid in order to eliminate those distortions. Anyway, thanks for clarifying this. I ll see if I can find a
          Message 4 of 11 , Aug 1, 2005
            > If you were to take a piece of graph paper and
            > draw several diamonds (4 lines) 10 units in diameter in completely
            > arbitrary fractional locations, then rasterize them (fill in the squares
            > that the line passes thru using some consistent rule), you will likely see
            > some similar irregularities.

            OK-- I see. In this case I'd rather "snap to grid" in order to
            eliminate those distortions. Anyway, thanks for clarifying this. I'll
            see if I can find a workaround, or else just live with it. Andrew.
          • Andrew Schulman
            One other thing I forgot to mention: thanks a lot for making ploticus. It s very capable and is really saving my butt right now. The net is full of software
            Message 5 of 11 , Aug 1, 2005
              One other thing I forgot to mention: thanks a lot for making ploticus.
              It's very capable and is really saving my butt right now.

              The net is full of software packages that claim to do all kinds of
              things. Most of them do some things well-- they make some hard tasks
              easy. But what they never tell you is what are the tasks that should be
              easy, but that turn out to be hard, or impossible. To find that out,
              you just have to dive in and start trying to solve your problem, and see
              how far you get before you hit the wall. For this reason I always feel
              some dread when I start using new software. You can lose a week getting
              up to speed with a tool that ultimately proves unable to solve your
              problem. This is what happened to me with the last charting software I
              tried to use (FusionCharts-- looks good, but won't take you very far).

              Well I've spent the last week working full-time with ploticus (using
              Perl to generate ploticus scripts), and whatever its limitations are, I
              haven't run up against them yet. I'm not even in the area of making
              ugly hacks yet. So congratulations, and thanks.

              Andrew.
            • dagoldman
              I think it would be useful to have an option for anti-aliased line drawing capability. I ve never done scatterplots, but I make pie charts in png format, and
              Message 6 of 11 , Aug 24, 2005
                I think it would be useful to have an option for
                anti-aliased line drawing capability. I've never done
                scatterplots, but I make pie charts in png format, and
                the lines can look jagged.

                I have no idea what would be involved technically, but
                I think it would be worth it if feasible. I appreciate
                your work.

                Daniel

                --- In ploticus@yahoogroups.com, "Stephen C. Grubb" <scg@j...> wrote:
                > Andrew,
                >
                > ploticus uses libgd to generate both PNG and GIF. I took a quick
                look at
                > the GD docs (www.boutell.com/gd) and it appears that recent
                versions of GD
                > do include antialiased line drawing capability. I'm not sure what
                would be
                > involved in getting ploticus to use that, and if it would be worth
                it, but
                > I'll make a note to look into it.
                >
                > Even with simple figures such as diamonds, aliasing can cause
                noticable
                > distortion. PNG and GIF are rasterized to 100 dots per inch (?)..
                your
                > data points are maybe 1/10 inch in diameter.. this gives you only a
                small
                > number dots to work with. If you were to take a piece of graph
                paper and
                > draw several diamonds (4 lines) 10 units in diameter in completely
                > arbitrary fractional locations, then rasterize them (fill in the
                squares
                > that the line passes thru using some consistent rule), you will
                likely see
                > some similar irregularities.
                >
                > -Steve
                >
                >
                >
                >
                > On Mon, 1 Aug 2005, Andrew Schulman wrote:
                >
                > >
                > > > Andrew, I believe this is caused by "aliasing" - a computer
                graphics term
                > > > that refers to error/distortion introduced by rasterization or
                numeric
                > > > rounding. It is most noticable with small objects such as your
                data
                > > > points, and lines that approach (but are not quite) horizontal
                or
                > > > vertical.
                > > >
                > > > Ploticus generates vector graphics, which must be rasterized to
                get them
                > > > into PNG/GIF. Then when PNG/GIF are rendered by the browser
                there may be
                > > > another round of rasterization that might not sync with the
                first round.
                > >
                > > OK. I looked at SVG and EPS output, and as you say they look
                fine.
                > >
                > > So then this is the fault of libpng and/or libgd? It's strange
                that the
                > > PNG and GIF outputs show exactly the same corruption-- maybe
                they're
                > > using the same rasterization algorithm. It's also disappointing,
                > > because after all these are diamonds, with sides sloped at 45
                degrees--
                > > they should be easy to get right.
                > >
                > >
                > >
                > >
                > >
                > > Yahoo! Groups Links
                > >
                > >
                > >
                > >
                > >
                > >
                > >
                > >
                >
                >
                > Stephen C. Grubb
                > Scientific Software Engineer, The Jackson Laboratory
                > 600 Main Street Bar Harbor, Maine 04609 USA
              • Stephen C. Grubb
                Hi, Later versions of GD have antialiased linedrawing capability. What s needed here is an interface added to ploticus grgd.c to use the antialias linedrawing
                Message 7 of 11 , Aug 25, 2005
                  Hi,

                  Later versions of GD have antialiased linedrawing capability. What's
                  needed here is an interface added to ploticus grgd.c to use the antialias
                  linedrawing functions (this would need to be shielded by #ifdefs), and
                  related Makefile additions.

                  I've added this to my TODO list and to the "requested features list"
                  on http://ploticus.sourceforge.net/doc/news.html ... anyone have the
                  ability to give this a whirl?

                  Steve


                  On Wed, 24 Aug 2005, dagoldman wrote:

                  > I think it would be useful to have an option for
                  > anti-aliased line drawing capability. I've never done
                  > scatterplots, but I make pie charts in png format, and
                  > the lines can look jagged.
                  >
                  > I have no idea what would be involved technically, but
                  > I think it would be worth it if feasible. I appreciate
                  > your work.
                  >
                  > Daniel
                  >
                  > --- In ploticus@yahoogroups.com, "Stephen C. Grubb" <scg@j...> wrote:
                  > > Andrew,
                  > >
                  > > ploticus uses libgd to generate both PNG and GIF. I took a quick
                  > look at
                  > > the GD docs (www.boutell.com/gd) and it appears that recent
                  > versions of GD
                  > > do include antialiased line drawing capability. I'm not sure what
                  > would be
                  > > involved in getting ploticus to use that, and if it would be worth
                  > it, but
                  > > I'll make a note to look into it.
                  > >
                  > > Even with simple figures such as diamonds, aliasing can cause
                  > noticable
                  > > distortion. PNG and GIF are rasterized to 100 dots per inch (?)..
                  > your
                  > > data points are maybe 1/10 inch in diameter.. this gives you only a
                  > small
                  > > number dots to work with. If you were to take a piece of graph
                  > paper and
                  > > draw several diamonds (4 lines) 10 units in diameter in completely
                  > > arbitrary fractional locations, then rasterize them (fill in the
                  > squares
                  > > that the line passes thru using some consistent rule), you will
                  > likely see
                  > > some similar irregularities.
                  > >
                  > > -Steve
                  > >
                  > >
                  > >
                  > >
                  > > On Mon, 1 Aug 2005, Andrew Schulman wrote:
                  > >
                  > > >
                  > > > > Andrew, I believe this is caused by "aliasing" - a computer
                  > graphics term
                  > > > > that refers to error/distortion introduced by rasterization or
                  > numeric
                  > > > > rounding. It is most noticable with small objects such as your
                  > data
                  > > > > points, and lines that approach (but are not quite) horizontal
                  > or
                  > > > > vertical.
                  > > > >
                  > > > > Ploticus generates vector graphics, which must be rasterized to
                  > get them
                  > > > > into PNG/GIF. Then when PNG/GIF are rendered by the browser
                  > there may be
                  > > > > another round of rasterization that might not sync with the
                  > first round.
                  > > >
                  > > > OK. I looked at SVG and EPS output, and as you say they look
                  > fine.
                  > > >
                  > > > So then this is the fault of libpng and/or libgd? It's strange
                  > that the
                  > > > PNG and GIF outputs show exactly the same corruption-- maybe
                  > they're
                  > > > using the same rasterization algorithm. It's also disappointing,
                  > > > because after all these are diamonds, with sides sloped at 45
                  > degrees--
                  > > > they should be easy to get right.
                  > > >
                  > > >
                  > > >
                  > > >
                  > > >
                  > > > Yahoo! Groups Links
                  > > >
                  > > >
                  > > >
                  > > >
                  > > >
                  > > >
                  > > >
                  > > >
                  > >
                  > >
                  > > Stephen C. Grubb
                  > > Scientific Software Engineer, The Jackson Laboratory
                  > > 600 Main Street Bar Harbor, Maine 04609 USA
                  >
                  >
                  >
                  >
                  >
                  >
                  > Yahoo! Groups Links
                  >
                  >
                  >
                  >
                  >
                  >
                  >


                  Stephen C. Grubb
                  Scientific Software Engineer, The Jackson Laboratory
                  600 Main Street Bar Harbor, Maine 04609 USA
                • dagoldman
                  If nobody else interested, I d be willing to give it a whirl. That assumes I can make some time, and can figure out the gd functions and grgd.c code. I m very
                  Message 8 of 11 , Sep 12, 2005
                    If nobody else interested, I'd be willing to give it a
                    whirl. That assumes I can make some time, and can figure
                    out the gd functions and grgd.c code. I'm very familiar
                    with C and makefiles. It would be at least a few months.
                    What's the procedure? Do I download the source, make
                    changes, test, send back to Steve? Wouldn't we want
                    to have an option for antialias on/off? Could you set
                    up that part? Daniel

                    --- In ploticus@yahoogroups.com, "Stephen C. Grubb" <scg@j...> wrote:
                    > Hi,
                    >
                    > Later versions of GD have antialiased linedrawing capability.
                    What's
                    > needed here is an interface added to ploticus grgd.c to use the
                    antialias
                    > linedrawing functions (this would need to be shielded by #ifdefs),
                    and
                    > related Makefile additions.
                    >
                    > I've added this to my TODO list and to the "requested features list"
                    > on http://ploticus.sourceforge.net/doc/news.html ... anyone have the
                    > ability to give this a whirl?
                    >
                    > Steve
                    >
                    >
                    > On Wed, 24 Aug 2005, dagoldman wrote:
                    >
                    > > I think it would be useful to have an option for
                    > > anti-aliased line drawing capability. I've never done
                    > > scatterplots, but I make pie charts in png format, and
                    > > the lines can look jagged.
                    > >
                    > > I have no idea what would be involved technically, but
                    > > I think it would be worth it if feasible. I appreciate
                    > > your work.
                    > >
                    > > Daniel
                    > >
                    > > --- In ploticus@yahoogroups.com, "Stephen C. Grubb" <scg@j...>
                    wrote:
                    > > > Andrew,
                    > > >
                    > > > ploticus uses libgd to generate both PNG and GIF. I took a
                    quick
                    > > look at
                    > > > the GD docs (www.boutell.com/gd) and it appears that recent
                    > > versions of GD
                    > > > do include antialiased line drawing capability. I'm not sure
                    what
                    > > would be
                    > > > involved in getting ploticus to use that, and if it would be
                    worth
                    > > it, but
                    > > > I'll make a note to look into it.
                    > > >
                    > > > Even with simple figures such as diamonds, aliasing can cause
                    > > noticable
                    > > > distortion. PNG and GIF are rasterized to 100 dots per inch
                    (?)..
                    > > your
                    > > > data points are maybe 1/10 inch in diameter.. this gives you
                    only a
                    > > small
                    > > > number dots to work with. If you were to take a piece of graph
                    > > paper and
                    > > > draw several diamonds (4 lines) 10 units in diameter in
                    completely
                    > > > arbitrary fractional locations, then rasterize them (fill in the
                    > > squares
                    > > > that the line passes thru using some consistent rule), you will
                    > > likely see
                    > > > some similar irregularities.
                    > > >
                    > > > -Steve
                    > > >
                    > > >
                    > > >
                    > > >
                    > > > On Mon, 1 Aug 2005, Andrew Schulman wrote:
                    > > >
                    > > > >
                    > > > > > Andrew, I believe this is caused by "aliasing" - a computer
                    > > graphics term
                    > > > > > that refers to error/distortion introduced by rasterization
                    or
                    > > numeric
                    > > > > > rounding. It is most noticable with small objects such as
                    your
                    > > data
                    > > > > > points, and lines that approach (but are not quite)
                    horizontal
                    > > or
                    > > > > > vertical.
                    > > > > >
                    > > > > > Ploticus generates vector graphics, which must be
                    rasterized to
                    > > get them
                    > > > > > into PNG/GIF. Then when PNG/GIF are rendered by the browser
                    > > there may be
                    > > > > > another round of rasterization that might not sync with the
                    > > first round.
                    > > > >
                    > > > > OK. I looked at SVG and EPS output, and as you say they look
                    > > fine.
                    > > > >
                    > > > > So then this is the fault of libpng and/or libgd? It's
                    strange
                    > > that the
                    > > > > PNG and GIF outputs show exactly the same corruption-- maybe
                    > > they're
                    > > > > using the same rasterization algorithm. It's also
                    disappointing,
                    > > > > because after all these are diamonds, with sides sloped at 45
                    > > degrees--
                    > > > > they should be easy to get right.
                    > > > >
                    > > > >
                    > > > >
                    > > > >
                    > > > >
                    > > > > Yahoo! Groups Links
                    > > > >
                    > > > >
                    > > > >
                    > > > >
                    > > > >
                    > > > >
                    > > > >
                    > > > >
                    > > >
                    > > >
                    > > > Stephen C. Grubb
                    > > > Scientific Software Engineer, The Jackson Laboratory
                    > > > 600 Main Street Bar Harbor, Maine 04609 USA
                    > >
                    > >
                    > >
                    > >
                    > >
                    > >
                    > > Yahoo! Groups Links
                    > >
                    > >
                    > >
                    > >
                    > >
                    > >
                    > >
                    >
                    >
                    > Stephen C. Grubb
                    > Scientific Software Engineer, The Jackson Laboratory
                    > 600 Main Street Bar Harbor, Maine 04609 USA
                  • Stephen C. Grubb
                    Daniel, probably the first thing that needs to be tackled is understanding how the GD feature works. Maybe we can both take a look http://www.boutell.com/gd/
                    Message 9 of 11 , Sep 13, 2005
                      Daniel,

                      probably the first thing that needs to be tackled is understanding how the
                      GD feature works. Maybe we can both take a look
                      http://www.boutell.com/gd/

                      and communicate again in a little while.

                      -Steve


                      On Tue, 13 Sep 2005, dagoldman wrote:

                      > If nobody else interested, I'd be willing to give it a
                      > whirl. That assumes I can make some time, and can figure
                      > out the gd functions and grgd.c code. I'm very familiar
                      > with C and makefiles. It would be at least a few months.
                      > What's the procedure? Do I download the source, make
                      > changes, test, send back to Steve? Wouldn't we want
                      > to have an option for antialias on/off? Could you set
                      > up that part? Daniel
                      >
                      > --- In ploticus@yahoogroups.com, "Stephen C. Grubb" <scg@j...> wrote:
                      > > Hi,
                      > >
                      > > Later versions of GD have antialiased linedrawing capability.
                      > What's
                      > > needed here is an interface added to ploticus grgd.c to use the
                      > antialias
                      > > linedrawing functions (this would need to be shielded by #ifdefs),
                      > and
                      > > related Makefile additions.
                      > >
                      > > I've added this to my TODO list and to the "requested features list"
                      > > on http://ploticus.sourceforge.net/doc/news.html ... anyone have the
                      > > ability to give this a whirl?
                      > >
                      > > Steve
                      > >
                      > >
                      > > On Wed, 24 Aug 2005, dagoldman wrote:
                      > >
                      > > > I think it would be useful to have an option for
                      > > > anti-aliased line drawing capability. I've never done
                      > > > scatterplots, but I make pie charts in png format, and
                      > > > the lines can look jagged.
                      > > >
                      > > > I have no idea what would be involved technically, but
                      > > > I think it would be worth it if feasible. I appreciate
                      > > > your work.
                      > > >
                      > > > Daniel
                      > > >
                      > > > --- In ploticus@yahoogroups.com, "Stephen C. Grubb" <scg@j...>
                      > wrote:
                      > > > > Andrew,
                      > > > >
                      > > > > ploticus uses libgd to generate both PNG and GIF. I took a
                      > quick
                      > > > look at
                      > > > > the GD docs (www.boutell.com/gd) and it appears that recent
                      > > > versions of GD
                      > > > > do include antialiased line drawing capability. I'm not sure
                      > what
                      > > > would be
                      > > > > involved in getting ploticus to use that, and if it would be
                      > worth
                      > > > it, but
                      > > > > I'll make a note to look into it.
                      > > > >
                      > > > > Even with simple figures such as diamonds, aliasing can cause
                      > > > noticable
                      > > > > distortion. PNG and GIF are rasterized to 100 dots per inch
                      > (?)..
                      > > > your
                      > > > > data points are maybe 1/10 inch in diameter.. this gives you
                      > only a
                      > > > small
                      > > > > number dots to work with. If you were to take a piece of graph
                      > > > paper and
                      > > > > draw several diamonds (4 lines) 10 units in diameter in
                      > completely
                      > > > > arbitrary fractional locations, then rasterize them (fill in the
                      > > > squares
                      > > > > that the line passes thru using some consistent rule), you will
                      > > > likely see
                      > > > > some similar irregularities.
                      > > > >
                      > > > > -Steve
                      > > > >
                      > > > >
                      > > > >
                      > > > >
                      > > > > On Mon, 1 Aug 2005, Andrew Schulman wrote:
                      > > > >
                      > > > > >
                      > > > > > > Andrew, I believe this is caused by "aliasing" - a computer
                      > > > graphics term
                      > > > > > > that refers to error/distortion introduced by rasterization
                      > or
                      > > > numeric
                      > > > > > > rounding. It is most noticable with small objects such as
                      > your
                      > > > data
                      > > > > > > points, and lines that approach (but are not quite)
                      > horizontal
                      > > > or
                      > > > > > > vertical.
                      > > > > > >
                      > > > > > > Ploticus generates vector graphics, which must be
                      > rasterized to
                      > > > get them
                      > > > > > > into PNG/GIF. Then when PNG/GIF are rendered by the browser
                      > > > there may be
                      > > > > > > another round of rasterization that might not sync with the
                      > > > first round.
                      > > > > >
                      > > > > > OK. I looked at SVG and EPS output, and as you say they look
                      > > > fine.
                      > > > > >
                      > > > > > So then this is the fault of libpng and/or libgd? It's
                      > strange
                      > > > that the
                      > > > > > PNG and GIF outputs show exactly the same corruption-- maybe
                      > > > they're
                      > > > > > using the same rasterization algorithm. It's also
                      > disappointing,
                      > > > > > because after all these are diamonds, with sides sloped at 45
                      > > > degrees--
                      > > > > > they should be easy to get right.
                      > > > > >
                      > > > > >
                      > > > > >
                      > > > > >
                      > > > > >
                      > > > > > Yahoo! Groups Links
                      > > > > >
                      > > > > >
                      > > > > >
                      > > > > >
                      > > > > >
                      > > > > >
                      > > > > >
                      > > > > >
                      > > > >
                      > > > >
                      > > > > Stephen C. Grubb
                      > > > > Scientific Software Engineer, The Jackson Laboratory
                      > > > > 600 Main Street Bar Harbor, Maine 04609 USA
                      > > >
                      > > >
                      > > >
                      > > >
                      > > >
                      > > >
                      > > > Yahoo! Groups Links
                      > > >
                      > > >
                      > > >
                      > > >
                      > > >
                      > > >
                      > > >
                      > >
                      > >
                      > > Stephen C. Grubb
                      > > Scientific Software Engineer, The Jackson Laboratory
                      > > 600 Main Street Bar Harbor, Maine 04609 USA
                      >
                      >
                      >
                      >
                      >
                      >
                      > Yahoo! Groups Links
                      >
                      >
                      >
                      >
                      >
                      >
                      >


                      Stephen C. Grubb
                      Scientific Software Engineer, The Jackson Laboratory
                      600 Main Street Bar Harbor, Maine 04609 USA
                    • dagoldman
                      Sounds good. BTW - I ve used gd a fair amount before. I use it to draw maps. The anti-aliasing has not been a problem for the maps. Probably because they are
                      Message 10 of 11 , Sep 15, 2005
                        Sounds good. BTW - I've used gd a fair amount before.
                        I use it to draw maps. The anti-aliasing has not been
                        a problem for the maps. Probably because they are so
                        large (like 600x600 pixels). I haven't looked at gd for
                        several years. I will update the mapping software with
                        new version of gd, and look into the anti-alias functions
                        at the same time. Daniel

                        --- In ploticus@yahoogroups.com, "Stephen C. Grubb" <scg@j...> wrote:
                        > Daniel,
                        >
                        > probably the first thing that needs to be tackled is understanding
                        how the
                        > GD feature works. Maybe we can both take a look
                        > http://www.boutell.com/gd/
                        >
                        > and communicate again in a little while.
                        >
                        > -Steve
                        >
                        >
                        > On Tue, 13 Sep 2005, dagoldman wrote:
                        >
                        > > If nobody else interested, I'd be willing to give it a
                        > > whirl. That assumes I can make some time, and can figure
                        > > out the gd functions and grgd.c code. I'm very familiar
                        > > with C and makefiles. It would be at least a few months.
                        > > What's the procedure? Do I download the source, make
                        > > changes, test, send back to Steve? Wouldn't we want
                        > > to have an option for antialias on/off? Could you set
                        > > up that part? Daniel
                        > >
                        > > --- In ploticus@yahoogroups.com, "Stephen C. Grubb" <scg@j...>
                        wrote:
                        > > > Hi,
                        > > >
                        > > > Later versions of GD have antialiased linedrawing capability.
                        > > What's
                        > > > needed here is an interface added to ploticus grgd.c to use the
                        > > antialias
                        > > > linedrawing functions (this would need to be shielded by
                        #ifdefs),
                        > > and
                        > > > related Makefile additions.
                        > > >
                        > > > I've added this to my TODO list and to the "requested features
                        list"
                        > > > on http://ploticus.sourceforge.net/doc/news.html ... anyone
                        have the
                        > > > ability to give this a whirl?
                        > > >
                        > > > Steve
                        > > >
                        > > >
                        > > > On Wed, 24 Aug 2005, dagoldman wrote:
                        > > >
                        > > > > I think it would be useful to have an option for
                        > > > > anti-aliased line drawing capability. I've never done
                        > > > > scatterplots, but I make pie charts in png format, and
                        > > > > the lines can look jagged.
                        > > > >
                        > > > > I have no idea what would be involved technically, but
                        > > > > I think it would be worth it if feasible. I appreciate
                        > > > > your work.
                        > > > >
                        > > > > Daniel
                        > > > >
                        > > > > --- In ploticus@yahoogroups.com, "Stephen C. Grubb" <scg@j...>
                        > > wrote:
                        > > > > > Andrew,
                        > > > > >
                        > > > > > ploticus uses libgd to generate both PNG and GIF. I took a
                        > > quick
                        > > > > look at
                        > > > > > the GD docs (www.boutell.com/gd) and it appears that recent
                        > > > > versions of GD
                        > > > > > do include antialiased line drawing capability. I'm not sure
                        > > what
                        > > > > would be
                        > > > > > involved in getting ploticus to use that, and if it would be
                        > > worth
                        > > > > it, but
                        > > > > > I'll make a note to look into it.
                        > > > > >
                        > > > > > Even with simple figures such as diamonds, aliasing can
                        cause
                        > > > > noticable
                        > > > > > distortion. PNG and GIF are rasterized to 100 dots per inch
                        > > (?)..
                        > > > > your
                        > > > > > data points are maybe 1/10 inch in diameter.. this gives you
                        > > only a
                        > > > > small
                        > > > > > number dots to work with. If you were to take a piece of
                        graph
                        > > > > paper and
                        > > > > > draw several diamonds (4 lines) 10 units in diameter in
                        > > completely
                        > > > > > arbitrary fractional locations, then rasterize them (fill
                        in the
                        > > > > squares
                        > > > > > that the line passes thru using some consistent rule), you
                        will
                        > > > > likely see
                        > > > > > some similar irregularities.
                        > > > > >
                        > > > > > -Steve
                        > > > > >
                        > > > > >
                        > > > > >
                        > > > > >
                        > > > > > On Mon, 1 Aug 2005, Andrew Schulman wrote:
                        > > > > >
                        > > > > > >
                        > > > > > > > Andrew, I believe this is caused by "aliasing" - a
                        computer
                        > > > > graphics term
                        > > > > > > > that refers to error/distortion introduced by
                        rasterization
                        > > or
                        > > > > numeric
                        > > > > > > > rounding. It is most noticable with small objects such
                        as
                        > > your
                        > > > > data
                        > > > > > > > points, and lines that approach (but are not quite)
                        > > horizontal
                        > > > > or
                        > > > > > > > vertical.
                        > > > > > > >
                        > > > > > > > Ploticus generates vector graphics, which must be
                        > > rasterized to
                        > > > > get them
                        > > > > > > > into PNG/GIF. Then when PNG/GIF are rendered by the
                        browser
                        > > > > there may be
                        > > > > > > > another round of rasterization that might not sync with
                        the
                        > > > > first round.
                        > > > > > >
                        > > > > > > OK. I looked at SVG and EPS output, and as you say they
                        look
                        > > > > fine.
                        > > > > > >
                        > > > > > > So then this is the fault of libpng and/or libgd? It's
                        > > strange
                        > > > > that the
                        > > > > > > PNG and GIF outputs show exactly the same corruption--
                        maybe
                        > > > > they're
                        > > > > > > using the same rasterization algorithm. It's also
                        > > disappointing,
                        > > > > > > because after all these are diamonds, with sides sloped
                        at 45
                        > > > > degrees--
                        > > > > > > they should be easy to get right.
                        > > > > > >
                        > > > > > >
                        > > > > > >
                        > > > > > >
                        > > > > > >
                        > > > > > > Yahoo! Groups Links
                        > > > > > >
                        > > > > > >
                        > > > > > >
                        > > > > > >
                        > > > > > >
                        > > > > > >
                        > > > > > >
                        > > > > > >
                        > > > > >
                        > > > > >
                        > > > > > Stephen C. Grubb
                        > > > > > Scientific Software Engineer, The Jackson Laboratory
                        > > > > > 600 Main Street Bar Harbor, Maine 04609 USA
                        > > > >
                        > > > >
                        > > > >
                        > > > >
                        > > > >
                        > > > >
                        > > > > Yahoo! Groups Links
                        > > > >
                        > > > >
                        > > > >
                        > > > >
                        > > > >
                        > > > >
                        > > > >
                        > > >
                        > > >
                        > > > Stephen C. Grubb
                        > > > Scientific Software Engineer, The Jackson Laboratory
                        > > > 600 Main Street Bar Harbor, Maine 04609 USA
                        > >
                        > >
                        > >
                        > >
                        > >
                        > >
                        > > Yahoo! Groups Links
                        > >
                        > >
                        > >
                        > >
                        > >
                        > >
                        > >
                        >
                        >
                        > Stephen C. Grubb
                        > Scientific Software Engineer, The Jackson Laboratory
                        > 600 Main Street Bar Harbor, Maine 04609 USA
                      Your message has been successfully submitted and would be delivered to recipients shortly.