Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

About two months ago I shared my "primitive" project and it was well received: https://news.ycombinator.com/item?id=12539109

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. :)

Let me know if you have any questions!



Very cool! Really beautiful output.

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?


Honestly didn't even think of that. Might have to look into it.


Aren't you limited then to C datatypes?


A pipe transmits bytes. You can transmit bytes in C datatypes, hence they're equivalent. Whatever serialization is used right now can be reused.


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 made some videos using primitive + ffmpeg a few months ago, glad to see it's still being developed!

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 :)


Love the use of the old Netscape animated logo.


Thanks, used it a few other times. Checkout https://theblackbox.ca/blog/vector-video/ .

Need to use it in some paintings though


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++


This makes me happy. :)


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 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.


Looks great! Do you have any plans to port this to other OS'? Would love something like this on GNU/Linux.


Seems the core is OS on Github. So you can use it on the command line or write a GUI for it yourself: https://github.com/fogleman/primitive


Interesting insights! I would love to hear more in how you exactly you bridged ObjC <-> Go.

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


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.



I wonder if it’s possible to turn this into a video filter.


Last time primitive was posted I wrote some bash scripts to make it work on video using ffmpeg - https://rybakov.com/blog/primitive/


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.


I don't see why that wouldn't be possible, it likely wouldn't run in realtime though.


Well, a problem could be that you get a lot of noise if all the frames are rendered independently.

You need a constraint that guarantees for example that without any changes in the video, you won't see any changing primitives.


> 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.


Oh, awesome! The actual renderer is open source (aka free) and I don't have to put it on the "one day when macOS" pile. Thanks. :)

(I will note that the website horizontally scrolls at 1024x768. A lot of sites do, though.)


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.


rather than swift to replace obj-c you could use https://github.com/dontpanic92/wxGo/ and make it 100% Go.

https://github.com/dontpanic92/wxGo/issues/8 needs work though fyi




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: