8 ms·
About two months ago I shared my "primitive" project and it was well received: https://news.ycombinator.com/item?id=12539109 https://news.ycombinator.com/item?i
by fogleman 10y ago
About two months ago I shared my "primitive" project and it was well received: https://news.ycombinator.com/item?id=12539109 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!
- buckhx 10y agoI 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.
- qubex 10y agoI 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.
- hftf 10y agoI wonder if it’s possible to turn this into a video filter.
- ultrafez 10y agoI don't see why that wouldn't be possible, it likely wouldn't run in realtime though.
- amelius 10y agoWell, 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.
- JoshTriplett 10y ago> 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.
- amelius 10y agoI 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.
- cproctor 10y agoI 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.
- spython 10y agoLast time primitive was posted I wrote some bash scripts to make it work on video using ffmpeg - https://rybakov.com/blog/primitive/ https://rybakov.com/blog/primitive/
- azinman2 10y agoVery 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?
- fogleman 10y agoHonestly didn't even think of that. Might have to look into it.
- AsyncAwait 10y agoAren't you limited then to C datatypes?
- icebraining 10y agoA pipe transmits bytes. You can transmit bytes in C datatypes, hence they're equivalent. Whatever serialization is used right now can be reused.
- azinman2 10y agoOr 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.
- ckluis 10y agoI 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++
- fogleman 10y agoThis makes me happy. :)
- hobarrera 10y agoAny 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.
- fogleman 10y agohttps://github.com/fogleman/primitive https://github.com/fogleman/primitive
- supernintendo 10y agoLooks great! Do you have any plans to port this to other OS'? Would love something like this on GNU/Linux.
- deepflame 10y agoSeems 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 https://github.com/fogleman/primitive
- SuperPaintMan 10y agoI made some videos using primitive + ffmpeg a few months ago, glad to see it's still being developed! https://theblackbox.ca/blog/primitive-triangles/ 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 :)
- rapind 10y agoLove the use of the old Netscape animated logo.
- SuperPaintMan 10y agoThanks, used it a few other times. Checkout https://theblackbox.ca/blog/vector-video/ https://theblackbox.ca/blog/vector-video/ . Need to use it in some paintings though
- andrewfromx 10y agorather than swift to replace obj-c you could use https://github.com/dontpanic92/wxGo/ https://github.com/dontpanic92/wxGo/ and make it 100% Go. https://github.com/dontpanic92/wxGo/issues/8 https://github.com/dontpanic92/wxGo/issues/8 needs work though fyi
- chamakits 10y agoI 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.
- dvcrn 10y agoInteresting 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 https://github.com/golang/go/wiki/Mobile
- i336_ 10y agoOh, 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.)
- Eduard 10y agoI'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.
- deleted 10y ago[deleted]
- deleted 10y ago[deleted]