Pages

Monday, February 15, 2010

Bring the (Perlin) Noise

If you just want the source code: The JavaScript Perlin noise generator code is here.

I mentioned in a previous post that I was working on a Perlin noise generator for Art Evolver.

Perlin noise is a function of (x, y) that produces a random-ish pattern. It's not completely random because it has smooth hills and valleys, but the distribution of those hills and valleys is random.

A side note about this algorithm: Usually if you're a computer scientist and you come up with a clever algorithm to solve a particular problem, you get an award from a university, or a CS-centric professional organization like the ACM or IEEE. Perlin got an Academy Award for this noise function. As in, the Oscar kind of Academy Award.  For an algorithm, something not usually consider artsy.  I found that interesting.

Anyways, rather than dive into Perlin's impenetrable description of how the algorithm works, I set out to find an existing JavaScript implementation. That let me to this message board, and specifically this example.

Unfortunately that implementation has some pretty serious directional artifacts:

Note the horizontal and vertical stripes.  There's almost an upside down cross in the lower right. SAAAATAAAAN!

Rather than try to fix that source code (which the author apparently closureized (making it very difficult to understand)) I kept searching.

From the main Wikipedia entry on Perlin noise, I ran across a variant called Simplex noise.  This is an improvement on the original algorithm, also written by Ken Perlin, in 2001.  That Wikipedia page linked to a paper by Stefan Gustavson(pdf) that explains both classical and Simplex Perlin noise in a much easier to grok way than anything I've read by Perlin himself.  I highly recommend Gustavson's paper if you found Perlin difficult.

I took the Java source code in Gustavson's paper and ported it to JavaScript, and the results are here on github.

I ran some performance comparisons between the classical and Simplex algorithms, and for 2-D I only saw a ~10% improvement with Simplex.  Granted, the latter is supposed to be faster in higher dimensions (classical is O(N^2) vs. simplex O(N) where N is the number of dimensions) so it doesn't matter much for my purposes.

Classical Perlin noise

Simplex Perlin noise

Subjectively I think I prefer the Simplex noise to classical, so I'll probably go with that for Art Evolver.

Again, the source code is here.

150 comments:

  1. Thank you for sharing with good, useful, helpful review. If you are looking for cheap insurance quotes, it necessary to know that when you get cheap house insurance, you save much more on rates from home insurers.

    ReplyDelete
    Replies
    1. A IEEE project is an interrelated arrangement of exercises, having a positive beginning and end point and bringing about an interesting result in Engineering Colleges for a particular asset assignment working under a triple limitation - time, cost and execution. Final Year Project Domains for CSE In Engineering Colleges, final year IEEE Project Management requires the utilization of abilities and information to arrange, plan, plan, direct, control, screen, and assess a final year project for cse. The utilization of Project Management to accomplish authoritative objectives has expanded quickly and many engineering colleges have reacted with final year IEEE projects Project Centers in Chennai for CSE to help students in learning these remarkable abilities.


      Spring Framework has already made serious inroads as an integrated technology stack for building user-facing applications. Spring Framework Corporate TRaining the authors explore the idea of using Java in Big Data platforms.
      Specifically, Spring Framework provides various tasks are geared around preparing data for further analysis and visualization. Spring Training in Chennai

      Delete
  2. Hi, Sean -

    I'm using your code for 2D simplex noise in JavaScript and trying to get it to reproduce something like the image you have posted above. I can get noise, but it is very pixelated, with none of the larger scale features you have above.

    All I am doing is creating a blank image data, setting each pixel to rgba(255,0,0,1.0), and running each pixel through the noise function. I set noise = (noise+1)/2 to bring it back to a [0,1] range and multiply it by the r channel and the alpha channel.

    Clearly, I'm doing something wrong. Would you be willing to share the code you used to generate the simplex photo? I'm happy to share my own, but won't poison your blog with it unasked.

    /ejt

    ReplyDelete
  3. Classic perlin noise is O(2^n) complexity and simplex perlin noise is O(n^2) complexity. Definitely not O(n) :)

    ReplyDelete
  4. Thank you for sharing some good, useful, useful comments. If you're looking for cheap insurance quotes, it is necessary to know, when you get cheap home insurance, you save more about rate from insurance companies.
    jerseys cheap

    ReplyDelete
  5. Thank you for taking the time to provide us with your valuable information. We strive to provide our candidates with excellent care.As always, we appreciate your confidence and trust in us..
    SAP Training in chennai

    ReplyDelete
  6. Thanks a lot for all your valuable article! We are really happy about the your...
    SAP Training in chennai

    ReplyDelete
  7. Interesting Article

    JavaScript Training in CHennai HTML5 Training in Chennai HTML5 Training in Chennai JQuery Training in Chennai JQuery Training in Chennai JavaScript Training in Chennai JavaScript Training in Chennai

    JavaScript Training in CHennai JavaScript Training in CHennai JQuery Online Training JQuery Online Training

    ReplyDelete
  8. Thanks for the informative article. This is one of the best resources I have found in quite some time. Nicely written and great info. I really cannot thank you enough for sharing.
    rpa training in Chennai | rpa training in bangalore

    ReplyDelete
  9. Great job.... Awesome list, just starting a blog and this is going to be a massive help. Thank you!

    Node JS Training in Chennai
    Node JS Training

    ReplyDelete
  10. You have a good point here!I totally agree with what you have said!!Thanks for sharing your views...hope more people will read this article!!!
    Haroon Ullah

    ReplyDelete
  11. I think this is one of the most significant information for me. And i’m glad reading your article. But should remark on some general things, The web site style is perfect, the articles is really great : D. Good job, cheers Click here

    ReplyDelete
  12. Hi, This is nice article you shared great information i have read it thanks for giving such a wonderful Blog for reader.
    fence repair jacksonville

    ReplyDelete
  13. Very nice bro, thanks for sharing this with us. Keep up the good work and Thank you for sharing information
    fence repair jacksonville

    ReplyDelete
  14. Thanks for a wonderful share. Your article has proved your hard work and experience you have got in this field. Brilliant .i love it reading.
    bathroom remodel broward county

    ReplyDelete
  15. This comment has been removed by the author.

    ReplyDelete
  16. Thanks for a wonderful share. Your article has proved your hard work and experience you have got in this field. Brilliant .i love it reading.
    fort lauderdale remodeling contractors

    ReplyDelete
  17. You have a good point here!I totally agree with what you have said!!Thanks for sharing your views...hope more people will read this article!!! vinyl fence tampa

    ReplyDelete
  18. Hi, This is nice article you shared great information i have read it thanks for giving such a wonderful Blog for reader.
    tile reglazing atlanta

    ReplyDelete
  19. I think this is one of the most significant information for me. And i’m glad reading your article.emergency water removal services miami

    ReplyDelete
  20. Hi, This is nice article you shared great information i have read it thanks for giving such a wonderful Blog for reader.
    bathtub refinishing and fiberglass expert los angeles

    ReplyDelete
  21. Superbly written article, if only all bloggers offered the same content as you, the internet would be a far better place. mold remediation companies miami

    ReplyDelete
  22. i have read it thanks for giving such a wonderful Blog for reader.
    phoenix remodeling contractors

    ReplyDelete
  23. Excellent experienced for me to read your great blog, I really impressed. I eagerly waiting for your future updates..
    safari hotel lahore

    ReplyDelete
  24. Finally I found a great post with interesting topic.
    123movie

    ReplyDelete
  25. סופסוף מישהו שתואם לדעותיי בנושא. תודה.
    קבוצת גבאי

    ReplyDelete
  26. סגנון כתיבה מרענן, תודה על השיתוף.
    פינות אוכל מעוצבות

    ReplyDelete
  27. תודה על השיתוף. מחכה לכתבות חדשות.
    שולחנות אוכל

    ReplyDelete
  28. פוסט מעניין, משתף עם העוקבים שלי. תודה.
    טבעת אירוסין

    ReplyDelete
  29. רציתי רק לשאול, אפשר לשתף את הפוסט בבלוג שלי?
    מזנונים לסלון

    ReplyDelete
  30. אין ספק שזה אחד הנושאים המעניינים. תודה על השיתוף.
    מילוי שפתיים

    ReplyDelete
  31. פוסט נחמד. חייב לשתף עם העוקבים שלי.
    ארגון חתונה

    ReplyDelete
  32. כל מילה. תודה על השיתוף, מחכה לעוד פוסטים בנושא.
    שטיח לחדר ילדים

    ReplyDelete
  33. Hi, of course this paragraph is truly pleasant and I have learned lot of things fromit on the topic of blogging. thanks.YesMovies

    ReplyDelete
  34. It’s in fact very difficult in this busy life to listen news on TV, thus I only use the web for that purpose,and take the latest news.123Movies

    ReplyDelete
  35. Good writeup, I am normal visitor of ones blog, maintain up the excellent operate, and It's going to be a regular visitor for a lengthy time.FMovies

    ReplyDelete
  36. It’s in fact very difficult in this busy life to listen news on TV, thus I only use the web for that purpose,and take the latest news.SolarMovies

    ReplyDelete
  37. Very nice thanks for sharing this with us. Keep up the good work and Thank you for sharing information
    gemcreature

    ReplyDelete
  38. This comment has been removed by the author.

    ReplyDelete
  39. הייתי חייבת לפרגן, תודה על השיתוף.
    מצלמות אבטחה

    ReplyDelete
  40. סגנון כתיבה מרענן, תודה על השיתוף.
    ניהול מוניטין

    ReplyDelete
  41. אין ספק שזה אחד הנושאים המעניינים. תודה על השיתוף.
    הדפסת תמונה על בלוק עץ

    ReplyDelete
  42. Thanks for the interesting blog that you have implemented here. Very helpful and innovative. Waiting for your next upcoming article.
    Digital Marketing Course In Kolkata

    ReplyDelete
  43. This incredible internet web site actually has all of the data I desired concerning this issue and didn’t recognize who to ask.

    ReplyDelete
  44. מעולה. תודה על הכתיבה היצירתית.
    מתנה ליולדת

    ReplyDelete
  45. הייתי חייבת לפרגן, תודה על השיתוף.
    חנויות למכירה

    ReplyDelete
  46. תמשיכו בפרסום פוסטים מעניינים כמו זה. תודה.
    פיתוח אפליקציות לאנדרואיד

    ReplyDelete
  47. movies123. AMAZING inspiration using this new kit

    ReplyDelete
  48. לגמרי פוסט שדורש שיתוף תודה.
    קאנבי

    ReplyDelete
  49. Thank you for sharing with good, useful, helpful review.
    אינטרקום לבית פרטי

    ReplyDelete
  50. 123movies. manufacturers, their history, and where they’re headed.

    ReplyDelete
  51. This is an excellent post I seen thanks to share it. It is really what I wanted to see hope in future you will continue for sharing such a excellent post.

    Data Science Course

    ReplyDelete
  52. I am really enjoying reading your well written articles. It looks like you spend a lot of effort and time on your blog. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work.
    Data Science Training Institute in Bangalore

    ReplyDelete
  53. If you don"t mind proceed with this extraordinary work and I anticipate a greater amount of your magnificent blog entries.

    Data Science Training

    ReplyDelete
  54. Great post i must say and thanks for the information. Education is definitely a sticky subject. However, is still among the leading topics of our time. I appreciate your post and look forward to more.
    Best Data Science Courses in Bangalore

    ReplyDelete
  55. I have recently started a blog, the info you provide on this site has helped me greatly. Thanks for all of your time & work.
    Data Science Course in Hyderabad | Data Science Training in Hyderabad

    ReplyDelete
  56. You are in point of fact a just right webmaster. The website loading speed is amazing. It kind of feels that you're doing any distinctive trick. Moreover, The contents are masterpiece. you have done a fantastic activity on this subject!
    I feel really happy to have seen your webpage and look forward to so many more entertaining times reading here. Thanks once more for all the details.
    Business Analytics Training in Hyderabad | Business Analytics Course in Hyderabad

    ReplyDelete
  57. Thanks for sharing your thoughts with us they are really interesting. I would like to read more from you.

    Bastion Balance Seoul

    ReplyDelete
  58. Wow that would be great party. i love get together with friends and family it greats time we pass with them.


    Global Asset Management Korea

    ReplyDelete
  59. Really very informative and creative contents.
    single trundle bed

    ReplyDelete
  60. Found your post interesting to read. I cant wait to see your post soon. Good Luck for the upcoming update. This article is really very interesting and effective, data science online training

    ReplyDelete
  61. Thanks for the Information.Interesting stuff to read.Great Article.
    I enjoyed reading your post, very nice share.
    Data Science Course Training in Hyderabad

    ReplyDelete
  62. Impressive blog to be honest definitely this post will inspire many more upcoming aspirants. Eventually, this makes the participants to experience and innovate themselves through knowledge wise by visiting this kind of a blog. Once again excellent job keep inspiring with your cool stuff.

    360DigiTMG Python Course

    ReplyDelete
  63. Truly incredible blog found to be very impressive due to which the learners who ever go through it will try to explore themselves with the content to develop the skills to an extreme level. Eventually, thanking the blogger to come up with such an phenomenal content. Hope you aarrive with the similar content in future as well.

    360DigiTMG Ethical Hacking Course

    ReplyDelete
  64. Really impressed by the information shared it was very useful and unique thank you.
    typeerror nonetype object is not subscriptable

    ReplyDelete
  65. חייב להחמיא על הכתיבה. מאמר מצוין.

    בריכות שחיה פיברגלס

    ReplyDelete
  66. yes it would be, once my friend gave me lecture about modesty it was amazing and heart touching.


    Garage Door Repair Cochrane

    ReplyDelete
  67. I wanted to leave a little comment to support you and wish you a good continuation. Wishing you the best of luck for all your blogging efforts.
    data science course

    ReplyDelete
  68. There is no dearth of Data Science course syllabus or resources. Learn the advanced data science course concepts and get your skills upgraded from the pioneers in Data Science.
    data science course bangalore
    data science course syllabus
    data science training in marathahalli
    data science syllabus for beginners

    ReplyDelete
  69. Wow! Such an amazing and helpful post this is. I really really love it. I hope that you continue to do your work like this in the future also.

    Apache Spark Training in Pune
    Spark Training Institute in Pune

    ReplyDelete
  70. Very awesome!!! When I seek for this I found this website at the top of all blogs in search engine.
    data science training

    ReplyDelete
  71. I will very much appreciate the writer's choice for choosing this excellent article suitable for my topic. Here is a detailed description of the topic of the article that helped me the most.
    unindent does not match any outer indentation level

    ReplyDelete
  72. I'm glad I found this blog! Occasionally, students want to know the keys to writing productive literary essays. Your first-class knowledge of this great job can become a suitable foundation for these people. Good
    unindent does not match any outer indentation level python

    ReplyDelete
  73. A digital marketing course will not ordinarily provide the tools to develop websites or write code for online use; these are highly technical skills which are best left to those who are willing to devote significant time to learn in detail. data science course syllabus

    ReplyDelete
  74. It was acceptable experience to find out about perilous accentuation. Useful for everybody looking regarding the matter.360DigiTMG masters in data science

    ReplyDelete
  75. Hello there, I sign on to your new stuff like each week. Your humoristic style is clever, keep it up
    data science course

    ReplyDelete
  76. Through this post, I realize that your great information in playing with all the pieces was exceptionally useful. I advise this is the primary spot where I discover issues I've been scanning for. You have a smart yet alluring method of composing.
    https://360digitmg.com/masters-in-full-stack-data-scientist-course/

    ReplyDelete
  77. Nice Information Your first-class knowledge of this great job can become a suitable foundation for these people. I did some research on the subject and found that almost everyone will agree with your blog.
    Cyber Security Course in Bangalore

    ReplyDelete
  78. Writing in style and getting good compliments on the article is hard enough, to be honest, but you did it so calmly and with such a great feeling and got the job done. This item is owned with style and I give it a nice compliment. Better!
    Cyber Security Training in Bangalore

    ReplyDelete
  79. stunning, incredible, I was thinking about how to fix skin inflammation normally.I've bookmark your site and furthermore include rss. keep us refreshed.
    data science course

    ReplyDelete
  80. I will really appreciate the writer's choice for choosing this excellent article appropriate to my matter.Here is deep description about the article matter which helped me more.
    data science training in Hyderabad

    ReplyDelete