TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Create generative background images from a string in Go

188 pointsby pravjover 10 years ago

11 comments

ImJasonHover 10 years ago
Some Go API style nits:<p>- it&#x27;s unusual to pass a map with expected keys like this. Normally you&#x27;d pass a struct like: p := New(Options{ BaseColor: &quot;...&quot;, Color: &quot;...&quot;, Generator: &quot;...&quot;, })<p>- You could define the known patterns as constants so they&#x27;re documented and so users don&#x27;t have to worry about typos<p>- Field names are normally camel-case without underscores, e.g., &quot;Base_color&quot; should be &quot;BaseColor&quot;<p>- You could use Go&#x27;s build-in image&#x2F;color package instead of accepting RGB strings, but that&#x27;s more of a judgement call.<p>If you&#x27;re accepting pull requests I might send you some, but they&#x27;re breaking API changes so it&#x27;s up to you.<p>All-in-all though it&#x27;s a cool project and I&#x27;m glad to see it in Go :)
评论 #8521633 未加载
chiiover 10 years ago
This is really cool! I quite like the js port <a href="https:&#x2F;&#x2F;github.com&#x2F;btmills&#x2F;geopattern" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;btmills&#x2F;geopattern</a> which you can drop into a website very easily.
评论 #8521225 未加载
disposition2over 10 years ago
Please excuse the somewhat off topic and possibly ignorant comment but is importing classes from a URL a feature unique to the Go language?
评论 #8521357 未加载
评论 #8521323 未加载
elwellover 10 years ago
&gt; <a href="https:&#x2F;&#x2F;guides.github.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;guides.github.com&#x2F;</a><p>At first, I thought &quot;create generative background images from a string&quot; meant that the algorithm could be fed any string and it would use that string as a sort of seed for the creation of fractal&#x2F;geometric art. So I thought that the text overlaying each of the rectangles on the GitHub Guides page was the seed text for the art underneath it. After reading further, I see that assumption is wrong. But I think it&#x27;s an interesting idea to couple the text on a page with automatically generated geometrically and chromatically pleasing art. I see this sort of organic and causative dynamic as the future of a large part of software development, especially as we enhance our toolset with the power of evolution (e.g., a website that evolves by itself through A&#x2F;B tests and little human intervention).
MichaelApprovedover 10 years ago
I see they have an MIT license, which is great, but I have a theoretical copyright question. If they didn&#x27;t license out the code and, instead, made a background-image-generating website, who would own the copyright to the computer generated images? I&#x27;m guessing they would but does anyone know for sure?
评论 #8522349 未加载
mVChrover 10 years ago
This is not meant to be snarky, but what&#x27;s the point of this? What use does the pattern being uniquely generated from a SHA of a distinct string have over a random pattern being generated from a SHA of some random string?
评论 #8523108 未加载
zorbashover 10 years ago
Nice idea and implementation. We developed a related application which creates colors from git commit sha strings. Have a look at <a href="http:&#x2F;&#x2F;gitart.me&#x2F;repos&#x2F;rails&#x2F;rails" rel="nofollow">http:&#x2F;&#x2F;gitart.me&#x2F;repos&#x2F;rails&#x2F;rails</a>
评论 #8521865 未加载
f2fover 10 years ago
nice project, and pretty cool visualizations!<p>i did port a lot of the xscreensavers to plan9 and then a few of them to go when go came out. this reminds me a lot of some of them. now if only there was a way to animate them!<p><a href="https:&#x2F;&#x2F;code.google.com&#x2F;p&#x2F;goxscr&#x2F;" rel="nofollow">https:&#x2F;&#x2F;code.google.com&#x2F;p&#x2F;goxscr&#x2F;</a><p>they work using x11, mostly on linux :)
jbranchaudover 10 years ago
This library and the ruby and JS ones are really cool. Does anyone have ideas of other patterns that could be implemented and added to them?
jerfover 10 years ago
Making this run as a locally-hosted website with net&#x2F;http would not be a difficult project at all.
sitkackover 10 years ago
Infinite hotel wallpaper.