Menu

Rendering curves

2010-08-20
2013-04-29
  • Bill Morris

    Bill Morris - 2010-08-20

    I got this working. The example here shows a simple method that appears to be what drawing programs use. The output, if blown up 8x, looks like it, anyway,  That's the curve on the left.  The curve on the right is just a little smoother, the result of another method I invented before figuring out the method on the left, which is faster and probably good enough. The one on the right is also slower, so probably not necessary.

    http://i299.photobucket.com/albums/mm309/LCARS24/CURVES.png

    I found some source code on doing this stuff, but it was huge and spread over many files. So i didn't bother with it.  Anyway, conventional or not, I've got it happening with a small amount of code, and the results look the same as what I see looking at blow-ups of drawings done with Illustrator.  So good enough.

    The SFML command for this will require staring and ending points and two control points. The color and thickness commands are each given once before a series of draw (for straight lines) and curve commands.

     
  • Bill Morris

    Bill Morris - 2010-08-20

    I had an idea on how the enhance the output quality of the second method, and it works.  Just two more lines of code and at high speed, it comes up to nearly the quality of the second image.  You can only see a small difference if they are blown up to 8x, but they actually look equally  smooth now.  This could actually replace the old image-enhancement routines of Viewscreen.

     
  • Imerion

    Imerion - 2010-08-21

    Nice! Fast and small code with great results, as it should be. :) If it's faster and/or better than the old image-enhancement routines I'd say it's a good idea to replace them. It's a cool effect, but on older computers it takes a few seconds and it does blur the image a bit too much sometimes. Though that might be unavoidable.

     
  • Bill Morris

    Bill Morris - 2010-08-28

    Here's another sample.  I was able to do something that eluded me before with the lines.  So this is a big improvement.  And there's one curve up in the corner.  The lines are done by unconventional means, and the curves will use the advantage of that but get some help from more conventional methodology.  And the drawing speed with this is unusually good, even though the antialiasing quality is very high.  I still have work to do on the curves, though.

    http://i299.photobucket.com/albums/mm309/LCARS24/GOODLINE.png

     
  • Bill Morris

    Bill Morris - 2010-09-01

    I figured out how to close the little gaps between segments for every type of curve.  That was the last technical hurdle.  So this will definitely be implemented in the next release.

     
  • Bill Morris

    Bill Morris - 2010-09-16

    I finally got this working to my satisfaction, with little, albeit complex, code and without a large memory buffer, which is unusual for this sort of thing and hard to program.

     
  • Imerion

    Imerion - 2010-09-17

    Sounds great! I look forward to seeing it in action.

     
  • Nobody/Anonymous

    I was able to modify one of those subroutines to do various image-enhancement tricks.  One thing it can do is add smoothness to a finished drawing created with Adobe Illustrator or Inkscape. Another is to add full antialiasing to a raw, jagged image, like one drawn with MS Paint, when downsizing it.  How much antialiasing is selectable, and it can actually exceed the quality of the Windows Vista thumbnail function. I gave it the acid test, which is an oval, and it really did beat out even the small windows thumbnail for smoothness, and with no color degradation, which is the shortcoming of other software I tried. This will be useful for MSDs but also when integrated into LCARS 24.

    Here's a WIP drawing that was given slight enhancement with this (lowest setting) :

    http://i299.photobucket.com/albums/mm309/LCARS24/AeonE.png

    Here's a  previous version, before enhancement, actually hardly needing it.  But there is a visible difference in smoothness of the outline.

    http://i299.photobucket.com/albums/mm309/LCARS24/AeonD.png

     
  • Imerion

    Imerion - 2010-12-18

    Impressive! Perhaps the "Enhance"-button in the image viewer can get some company. Or maybe a new app called image-enhancement would be better. It could include image resize (zoom), greyscale and Save As functions as well since they're already implemented. Where did those go by the way? I am sure I've seen the greyscale option somewhere, but now when I'm looking I can't find it…

     
  • Nobody/Anonymous

    Grayscale could be there.  Where you saw it, I think, was in Gates.  But Viewscreeen will be getting some options.  I'm also going to see if it's possible to do a better job with the zoom function for the MSDs.

    Here's a somewhat amazing demo.  This is the result of running a quick, sloppy tracing of the work bee outline through one mode of this new routine.  These were jagged lines, but look what happened to the image:

    http://i299.photobucket.com/albums/mm309/LCARS24/WBTEST.png

    Of course, the programmers of Adobe Illustrator, Corel Draw, etc. had all this figured out years ago.

    Another thing it can do is take a finished drawing from Illustrator, etc. and make it a little smoother without color degradation, as I mentioned..  It has various settings for various tasks.

     
  • Imerion

    Imerion - 2010-12-23

    Very smooth indeed!

    It might have been Gates, but I think I remember an option to make an image greyscale somewhere else. Perhaps I am just confusing it with something. Either way, some more options on Viewscreen sounds nice!
    What part of the zoom do you mean needs improvement? Perhaps all you need is to use these new antialiasing functions on the zoomed image instead of the old one. Or maybe that is what you meant. :)

     

Log in to post a comment.