As a result, I decided to follow through and make more of it. So today I am announcing Primitive for macOS, now available on the Mac App Store.
The core is still implemented in Go. The GUI is written in Objective-C (haven't bothered to learn Swift yet!) and communicates with the Go process over stdin/stdout via NSTask and NSPipe. The rendering is done on the front-end; the backend just sends shape coordinates and such.
I spent a lot of time fleshing out the GUI layout to make it as simple yet powerful as possible. I hope you find it to be intuitive and I hope that you are pleased with the resulting images. I look forward to seeing what people do with the app. :)
I remember seeing the lib a few months ago and thought it was neat. I even went to find the repo and call shenanigans on this post before I looked at the comments. Really cool to see you following up with it.
I downloaded your app from the MAS and find it beautiful.
I have previously implemented a "compressed sensing" image system in Processing, this produces very similar results.
I was wondering whether you will be adding support for exporting animations, both of the image being built up and (as you mention) of many images matching criteria formed from different seeds.
> Well, a problem could be that you get a lot of noise if all the frames are rendered independently.
The site shows an example of what a still image looks like if rendered with the same parameters several times; it provides an interesting animated effect. I think that might produce an interesting animation style.
But for a more consistent style between frames, it'd help to have a way to seed the RNG consistently.
I think there is more to it than just seeding the RNG consistently.
For example: what if you have a minor change in the area of the screen that got the first primitive (and hence used the first few RNG numbers)? Then all the remaining primitives will use different RNG numbers.
I think the problem becomes more difficult: you want to find the primitives that result in the minimal change wrt the previous frame.
I bet it would look really cool to have 3D primitives that can be oriented with respect to the time dimension. So for example, a spherical primitive would be a circle that grows and shrinks as frames progress.
Curious why you're using pipes to communicate when you can use CGO to make the go stuff it's own static C library and communicate bidirectionally that way? Granted it's a bit more complex than that sounds (I've did this to bring v.io to iOS), but I'd figure that'd still be easier than the alternative?
Or even better, actual bools and strings like a real API.
I don't know what the Go library looks like in terms of an API, but the pipes are already requiring serialization. This at least makes that hookup slightly easier, although CGO bridge has some overhead to it, so it wouldn't completely surprise me if a FIFO unix buffer was in fact faster especially if there's serialization in both situations.
I just put a complex image with shadows/light sources and it did an amazing job. It was fun to watch and eventually stop. It was even cooler to open in sketch and see all the shapes and the way the image was formed. A++
Any chance that we can get the core for other OSs? Sounds like it's where all the magic happens and others could quickly work on UIs for it on other platforms.
Awesome, I see you've added new features too. There goes my evening. A suggestion for video, allow loading the shape data for the previous frame and use that as a starting point. Could bring you closer to real time processing :)
I missed the original post on the primitive core, cause I hadn't seen this.
Just tried it out, and it is probably the coolest 'Show HN' I've ever seen. Spent the last 2 hours playing around with some pictures and different configs, and I absolutely love what this is doing.
Also, really appreciate that you provided a value add to the product sold, without compromising the open source core. Thank you for that.
Anyways, good job, and good luck. Hope this sells tons, cause it truly is amazing.
I'm surprised I couldn't find any SVG versions of sample images, as (I assume) for many interested parties, the vector format output is the unique selling proposition for a, well, vector-based application.
If the algorithm could work well on a mobile device, this would make awesome camera filters for something like Instagram, likely could make some $ or get someone to buy it from you.
Animated raster images depicting a sequence of overlaid primitive vector shapes for a single input? Or just iterating the existing algorithm over a video input?
Cool, I'm looking forward to giving this a try... I've always been a big fan of geometric art.
I do wish I could buy it from your site vs the App store... I've just had so many be experiences w/ having to 'transfer my license' away from App store purchases.
I did a simulated annealing version 5 or 6 years ago (so I could have a neat Christmas card), and was surprisingly slow (well, I had a slower computer, too). Congrats on making it fast and nice (and exporting in vectors, which is something I didn't bother to even try!)
I found similar results in my simulations as well.
Even my genetic implementations were "slowish" both simple hill climbing (single parent) and two parent with cross-over/mutation. Though, after seeing this awesome implementation, I'm going to go do some work on improving mine.
Guess until then imagemagick + command line primitive can do the business (convert video to a series of images w/ IM, process with primitive, recreate the video from processed images w/ IM).
Seen that before. Cool from the evolutionary algorithm standpoint, but Primitive produces nicer looking results in mere seconds. :) But we both were inspired by the same original Mona Lisa project.
Cool project, best of luck. Off topic question: are you planning to focus more in MAS, do you think it's still viable to make a living off it solo? (yes, depends on COL and needs, still interested in your perspective)
If you're able to do a follow up post in e.g. a month I'd enjoy reading!
Especially if you decide to sell directly I'd be curious how that fares vs the App Store.
This is really cool - just bought it. I'd like a good way to get photos from the Photos app into it, either by sharing them or by directly accessing the photo roll from within Primitive.
The Lenna image that is drawn is originally from a nude image in Playboy [1]. It causes me to associate your work with sexism and pornography. I'm sure not everyone makes this association, but why not use a free stock image or a great work of art for the demo?
I don't think you're going to have any effect simply due to the 1. complexity of the image, as it's a real photograph, and 2. the complexity of colors and hues in the image.
there's a reason why it's seen as a "standard test image", and not as some fodder for sexism. it's the above plus historical baggage.
Someone else mentioned this and I agreed, so I already replaced it before seeing this comment. The Lenna image did make a good demo, but so do other images.
I find faces a little problematic actually. Since facial recognition is such a huge part of our brain, it always seems like Primitive is ignoring the face too much and spending time on extraneous details. (I've previously experimented with weighting some areas of an image more than others in the algorithm because of this.)
I think the flower works well, but I might replace it yet again if I find an even better demo when I have more time to spend on it.
Upvoted (as with all your other posts here) because you made a perfectly valid criticism that the program author agreed with and adopted, but the geek boys got typically defensive.
>why not use a free stock image or a great work of art for the demo
Because a stock image is not standardized and has not been a standard for decades like Lenna has.
It's just about impossible to go back in history and change all the research papers and recompile all the algorithms and update them to a new image.
Of course we could still do it if enough people cared. But do we? is pornography morally bad? What about cropped pornography like lenna? Do the majority of people even think pornography is sexism? If it is sexism, then does that inherently make pornography bad? is all sexism bad? Is it bad that men are attracted to females/vis-versa and that sexually biased attraction exists? To me I would answer in the negative to all of these.
While I personally feel like porn is dubious (primarily due to the exploitative nature of the industry) I feel like this whole controversy is way overblown.
Before this thread I had no idea said controversy even existed. As far as I knew the Lenna image was just a pretty decent photo, not the result of cropping a playboy cover.
I guess the idea that a derivative artwork can be seen a unique artwork in its own right doesn't mean anything anymore...
Two comments:
1. The original photos are beautiful. What equipment are you using? We're extremely spoiled here in the PNW!
2. Have you considered printing any of the Primitive forms out and displaying them?
Thanks! Equipment on all four were taken with a Sony Alpha A7s with 35mm lens. I haven't thought about printing any of the Primitive images, but mostly because I only downloaded it about 20 minutes before posting these images. They might look interesting on canvas, tempting!
Too late to edit my comment, but I added a couple more photos if you want to check them out. A night scene that I thought would be a tough test (hard to do stars!) and some columnar basalt that turned out great.
Thanks, it was an early season night (Milky Way is only visible in the Summer here) and it started cloudy. I stuck it out and got lucky. That really bright point above the mountain is Mars, pretty neat!
It's just a simple jQuery plug-in called Twenty Twenty that I found when I had the idea to take the same picture at different times and compare the result. Drag/swipe across ended up working better as an effect than my original fade-in idea. You can view source to see how it works, it's really simple.
Playing with that comparison, it looks like there's a +y bias in your algorithm. If I didn't say that in a way that's clear, check out the Mowich Lake picture in particular. Its features are mirrored above and below the shoreline, so the generated features should also be somewhat mirrored, right?
Instead, the entire visual center of the image gets moved up by the Primitivization. It looks like trees on the top half get their exposed tops connected, but those same crowns are cropped in the reflection.
This is such a phenomenal project. Thanks for making it!
149 comments
[ 3.9 ms ] story [ 374 ms ] threadAs a result, I decided to follow through and make more of it. So today I am announcing Primitive for macOS, now available on the Mac App Store.
The core is still implemented in Go. The GUI is written in Objective-C (haven't bothered to learn Swift yet!) and communicates with the Go process over stdin/stdout via NSTask and NSPipe. The rendering is done on the front-end; the backend just sends shape coordinates and such.
I spent a lot of time fleshing out the GUI layout to make it as simple yet powerful as possible. I hope you find it to be intuitive and I hope that you are pleased with the resulting images. I look forward to seeing what people do with the app. :)
Let me know if you have any questions!
I have previously implemented a "compressed sensing" image system in Processing, this produces very similar results.
I was wondering whether you will be adding support for exporting animations, both of the image being built up and (as you mention) of many images matching criteria formed from different seeds.
You need a constraint that guarantees for example that without any changes in the video, you won't see any changing primitives.
The site shows an example of what a still image looks like if rendered with the same parameters several times; it provides an interesting animated effect. I think that might produce an interesting animation style.
But for a more consistent style between frames, it'd help to have a way to seed the RNG consistently.
For example: what if you have a minor change in the area of the screen that got the first primitive (and hence used the first few RNG numbers)? Then all the remaining primitives will use different RNG numbers.
I think the problem becomes more difficult: you want to find the primitives that result in the minimal change wrt the previous frame.
Curious why you're using pipes to communicate when you can use CGO to make the go stuff it's own static C library and communicate bidirectionally that way? Granted it's a bit more complex than that sounds (I've did this to bring v.io to iOS), but I'd figure that'd still be easier than the alternative?
I don't know what the Go library looks like in terms of an API, but the pipes are already requiring serialization. This at least makes that hookup slightly easier, although CGO bridge has some overhead to it, so it wouldn't completely surprise me if a FIFO unix buffer was in fact faster especially if there's serialization in both situations.
https://theblackbox.ca/blog/primitive-triangles/
Awesome, I see you've added new features too. There goes my evening. A suggestion for video, allow loading the shape data for the previous frame and use that as a starting point. Could bring you closer to real time processing :)
Need to use it in some paintings though
https://github.com/dontpanic92/wxGo/issues/8 needs work though fyi
Just tried it out, and it is probably the coolest 'Show HN' I've ever seen. Spent the last 2 hours playing around with some pictures and different configs, and I absolutely love what this is doing.
Also, really appreciate that you provided a value add to the product sold, without compromising the open source core. Thank you for that.
Anyways, good job, and good luck. Hope this sells tons, cause it truly is amazing.
Do you mean you just ship a compiled Go binary as part of your app and interact with that? If yes, did apple not say anything about it during review?
I saw that you can call Go in mobile apps [0]. I'm wondering if that's also applicable for desktop apps
[0]: https://github.com/golang/go/wiki/Mobile
(I will note that the website horizontally scrolls at 1024x768. A lot of sites do, though.)
Edit: Go has good GIF support but doesn't really do dithering and stuff.
I do wish I could buy it from your site vs the App store... I've just had so many be experiences w/ having to 'transfer my license' away from App store purchases.
I'm a sucker for this kind of thing. Rotoscoping always fascinated me and I'm still looking for something that converts photos to pencil drawings.
Here is the original concept, source included (2008): https://rogeralsing.com/2008/12/07/genetic-programming-evolu...
https://github.com/fogleman/primitive#inspiration
Even my genetic implementations were "slowish" both simple hill climbing (single parent) and two parent with cross-over/mutation. Though, after seeing this awesome implementation, I'm going to go do some work on improving mine.
http://alteredqualia.com/visualization/evolve/
https://cdn.rawgit.com/hansihe/CanvasEvolve/master/index.htm...
1: http://watercolorbot.com/
Just an FYI, the links at the top link to the current page instead of sections.
If you're able to do a follow up post in e.g. a month I'd enjoy reading! Especially if you decide to sell directly I'd be curious how that fares vs the App Store.
Thanks for sharing here, nice to see this.
Great work!
Looks like a great tool to be honest, and the UI looks beautiful. Wish you the best, and keep up the awesome work!
[1] - https://en.wikipedia.org/wiki/Lenna#Controversy
https://en.wikipedia.org/wiki/Lenna
there's a reason why it's seen as a "standard test image", and not as some fodder for sexism. it's the above plus historical baggage.
It's a minor matter, but it's a shame you felt the need to remove the image when it's so useful and relevant.
I think the flower works well, but I might replace it yet again if I find an even better demo when I have more time to spend on it.
Because a stock image is not standardized and has not been a standard for decades like Lenna has.
It's just about impossible to go back in history and change all the research papers and recompile all the algorithms and update them to a new image.
Of course we could still do it if enough people cared. But do we? is pornography morally bad? What about cropped pornography like lenna? Do the majority of people even think pornography is sexism? If it is sexism, then does that inherently make pornography bad? is all sexism bad? Is it bad that men are attracted to females/vis-versa and that sexually biased attraction exists? To me I would answer in the negative to all of these.
Before this thread I had no idea said controversy even existed. As far as I knew the Lenna image was just a pretty decent photo, not the result of cropping a playboy cover.
I guess the idea that a derivative artwork can be seen a unique artwork in its own right doesn't mean anything anymore...
Could you elaborate on this?
If you think that everyone in the porn industry wants to be there and loves their job then you're missing the wood for the trees...
http://www.jongales.com/timeshift/primitive/
http://zurb.com/playground/twentytwenty
Here is the photo that kicked off my idea:
http://www.jongales.com/rainier/timeshift/
I also did another in the Spring that turned out nice:
http://www.jongales.com/timeshift/columbia-river-gorge/
Instead, the entire visual center of the image gets moved up by the Primitivization. It looks like trees on the top half get their exposed tops connected, but those same crowns are cropped in the reflection.
This is such a phenomenal project. Thanks for making it!