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

taking advantage of GD antialiased linedrawing capabilities

Expand Messages
  • 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 1 of 11 , Aug 25, 2005
    • 0 Attachment
      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 2 of 11 , Sep 12, 2005
      • 0 Attachment
        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 3 of 11 , Sep 13, 2005
        • 0 Attachment
          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 4 of 11 , Sep 15, 2005
          • 0 Attachment
            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.