The Shape of Everything
A website mostly about Mac stuff, written by Gus Mueller
» Acorn
» Twitter
» Pizza Lab
» Code
» Archive
January 18, 2016

For What It’s Worth: A Review of the Wu-Tang Clan’s “Once Upon a Time in Shaolin” by Dan Cohen:

"This is what we know: On November 24, 2015, the Wu-Tang Clan sold its latest album, Once Upon a Time in Shaolin, through an online auction house. As one of the most innovative rap groups, the Wu-Tang Clan had used concepts for their recordings before, but the latest album would be their highest concept: it would exist as only one copy—as an LP, that physical, authentic format for music—encased in an artisanally crafted box. This album would have only one owner, and thus, perhaps, only one listener. By legal agreement, the owner would not be allowed to distribute it commercially until 88 years from now."

Wu-Tang Clan is a national treasure.

January 15, 2016

I've just uploaded a new beta build of Acorn (v5.3b) which includes a feature that has been requested many times over the years: laying out text in a circle.

New and Shiny

With this new feature, I can finally reproduce Flying Meat's logo in Acorn. It always irked me whenever someone would write in asking how to do this, as there is text in a circle in our logo, so it must be possible. But FM's logo was made over a decade ago in Illustrator, years before work on Acorn was started.

Most text features you'd expect work with it. Right, left, and center alignment, and you can rotate the text beyond that as well. Kerning works as expected and Acorn even supports ligatures and gets the selections right with it.

As a first go at this feature, it's pretty good. There are still things to clean up and add to it, but overall I'm fairly happy with it.

And before everyone asks, yes, this is a prelude to text on a curve. That feature won't be making it into Acorn 5.3, but this is a nice step towards it some day. No promises of course.

Want to play with it? Head on over to the latest builds page and grab a copy of the beta.

January 5, 2016

In their own words, Sound Off works to increase access to professional settings for marginalized peoples in tech.

And to start things off they are raising money for ASL interpreters for the AlterConf conferences:

"We're tremendously excited to lead off our first fundraising campaign raising money to provide American Sign Language (ASL) interpreters and live captioning for the 2016 series of AlterConf conferences. Sign language and live captioning benefit not only hearing impaired but attendees for whom English may not be their primary language."

Sound Off has some very worthy, and very realistic goals. And as Brent Simmons says, people of the future will look back and judge us for how well or poorly we expanded our tribe.

We need to expand, and we need to be inclusive. Good thoughts are great, but helping out with a little bit of money is even better.

December 3, 2015

Christopher Phin: Is the Apple Pencil a true design tool?:

"Let me be completely clear: this is the best digital drawing tool there has ever been. Better than a Wacom Intuos, better than a Wacom Cintiq, and better, by a margin so wide it's downright comical, than any other stylus for iOS or Android.

"Actually, let me be even clearer: pair this stylus with the iPad Pro – the only device it currently works with – and at a hardware level, it's capable of a fluidity and unthinking naturalness that genuinely comes as a shock. You have never used anything so quick, so lovely, so wonderfully analogue."

Tell us how you really feel.

November 25, 2015

Hello fine people of the Internet. Good day to you.

I'm currently putting the finishing touches on the next version of Acorn, v5.2, and I'd like to invite you to try it out. You can download Acorn 5.2b1 from the latest builds page.

There's two notable changes that I'd like to call out. The first is the color well in the tools palette. It has a simple new look, which I think clears up quite a bit of confusion that people have had in the past when trying to figure out which color was used for stroke, and which was for the fill.

I think it's pretty obvious now which color is going to be used for fill, and which color is stroke. In addition, the fill and stroke checkboxes in the inspector now have little color wells you can click on to quickly change the color of your selected shapes.

The second new feature, and my personal favorite and one that I've been wanting for years, is deep color support for the 2015 iMac 5k as well as to the Late 2013 Mac Pros.

I'll get to the technical bits in a minute, but the short version is this: no more banding, more colors, and a wider range of accuracy and values for your filters to play with.

Since it's creation, OS X has been sending 24 bits of color (aka "True Color", or 16.7 million colors) to our displays. Even if you bought a fancy display which was capable of showing more colors, you would only see 24 bits because the graphics plumbing just wasn't in place to push more color.

However, with OS X 10.11.1, that changed. And we even have some hardware to show it off.

The displays in the iMac 5k (the most recent, as well as the previous generation) are capable of receiving 30bit "deep color" when running on 10.11.1 and later. The late 2013 Mac Pros are also candidates for this if they have a decent monitor hooked up.

So how many colors can Acorn 5.2 push to the display now?

Over one Billion

1,073,741,824 to be exact.

That's kind of amazing.

What does that mean in practice? Color banding is a thing of the past. Dithering when using the gradient tool in Acorn is no longer happening. You also have a wider range of values to manipulate when adjusting exposure or temperature or other color controls. You can actually see all the colors when taking photos with your 14 bit RAW cameras now.

It's great, and it's the future, and I love it.

So what do you need for this? Obviously, you'll need the Acorn 5.2 preview, and a 5k iMac or a Mac Pro with a 30 bit display.

If you just want to view images with deep color, you can do so with Acorn 5.2 and OS X 10.11.1.

If you want to use Acorn 5.2 to adjust or make new deep color images, you'll need to be running the latest OS X 10.11.2 public beta. It contains some fixes that are needed for Acorn to work correctly when handling deep color images.

And finally, if you're creating new images with deep color support, you're going to want to create your images with 16 bpc (bits per component or channel)*. This does mean that your file sizes will be bigger (more color data equals bigger files), but in my opinion it's worth the tradeoff.

And as always, if you run into any issues, questions, or ideas, let us know by emailing support@flyingmeat.com.

* Technically a 16 bpc image is capable of having 281,474,976,710,656 different colors, but we don't have display technology available to show them all. Images like this are still pretty useful for certain scientific applications though.

** It's really hard to show off screenshots of what deep color looks like in practice since web browsers are only showing 8bpc images. So here's a crappy photo of Acorn 5.2 (on the left) and Photoshop (right) displaying a 16bpc image. This is of course is a 8bpc image, but it shows the compressed range of PS vs Acorn anyway.

*** You can download that test Acorn image from here: purple_green_gradient_16bpc.png, or use the native Acorn version with the live gradient filter from here: purple_green_gradient_16bpc.acorn. Try switching the latter image between 16 and 8 bpc to see the banding come and go.

November 20, 2015

I've been using Wacom tablets for about 20 years now. And in all that time, their desktop tablets have been the standard and the most recommended tablets by just about everyone. I love Wacom products. I've had a Cintiq, multiple Intuos tablets, various incarnations of their Bamboo products, a Graphire, and whatever the heck it was they were selling 20 years ago. They have all been great.

I love tablets. I love drawing with a good stylus that works together with the tablet and when built together correctly they become something that feels empowering and wonderful. Endless pages in a sketchbook. All the colors I could ask for. Pencils, brushes, and watercolor all working together in harmony.

Every single stylus that has been made for the iPad or iPhone has been a pile of dog shit when compared to what you can do with a Wacom tablet. Even compared to what you could do 20 years ago with a Wacom tablet. The KoalaPad on an Apple //e was probably better.

It's been hard, and upsetting. And so much money wasted on crappy iOS styluses. I stopped paying attention whenever a new stylus was announced, since I was inevitably let down.

And then this week I got the Apple Pencil (which is Apple speak for a stylus) and an iPad Pro. This new tablet from Apple has the hardware support needed to make a useful stylus. Hardware support that has been missing for five long, very long, agonizing years.

And It's God Damn Amazing.

It feels absolutely right. Super low latency, palm rejection, and … it just works.

Is it the same as drawing in my sketchbook? No. Of course not. I'm rubbing a plastic tip across a glass screen.

It's still God Damn Amazing though.

Is it better? With the right software, possibly, for my use. I've tried a handful of drawing apps and right now my favorite is Procreate, with Adobe Sketch coming in second. If you don't want to pay a few bucks on those apps (shame on you!), the built in Notes app has some pretty decent sketching tools as well.

I find that when using the HB Pencil in Procreate, I get something that is very, very close to what I feel when I'm drawing in my sketchbooks. But of course now I've got layers and many colors and a perfect eraser to work with. And endless pages. I love it. I'm drawn to it. It's wonderful. You should absolutely try one if you haven't already.

Text on a page doesn't do it justice. Videos don't do it justice. Try it out, that's the only way to truly judge it.

I do have minor complaints, such as the price ($99 USD). I wish it was half that, just so it's easier for everyone to purchase. But after using one for a few days, you could double the price and I'd still buy it. It's that good.

People keep on asking me when I'm going to port Acorn to iOS. I have no plans to at this time, for various reasons. I've certainly thought of making a new type of drawing app for iOS, but honestly- I like being able to just use the hardware.

Every single time I fire up Acorn and start using my Intuos with it, I find something I want to change about the brush engine. I find oddball little behaviors I think I can improve, or go off investigating why a particular brush stamp might be off by a pixel or two. So I never actually get to draw anything.

I don't currently have that problem with the iPad. If I'm sketching in Procreate and I come across something that I'd do differently… well, it doesn't matter. I don't have the source code so I can't change anything. I can just sketch and create, and not fret about little things. It's liberating.

October 16, 2015

Acorn 5.1.1 is mostly about bug fixes (out now for direct, waiting for review for Apple's App Store), but I did manage to add a couple of new Automator actions to it- Scale and Export to Folder.

Dev talk: an Automator extension is a little Cocoa bundle that gets run in another process, so you need to find some way to communicate from that bundle to your application. For Acorn, I use Distributed Objects. And for years it worked great, until the App Store Sandbox was introduced. (Boo, hiss!)

Since the Sandboxed version of Acorn didn't have permission to open files or save files that it hadn't previously encountered, batch processing things in Automator became pretty impossible. Apple had "solved" this for most developers who script their apps using AppleScript. When you pass an AppleScript file reference to your app, some magic happens in the background and holes are punched in the Sandbox, which allows the app to open and save to locations that it otherwise wouldn't be allowed to.

But adding AppleScript support is a pain in the ass, so I mostly avoided it and encouraged folks to use the direct version of Acorn if they wanted to do batch processing of things.

But recently when working on the new export action, I wondered if AppleScript was sending around NSURL Bookmark data for the file references, and maybe that was how it was able to get through the sandbox restrictions. So I tried that out, but with no luck. You can't make a bookmark to a file that doesn't exist- which is what I'd need for exporting images. Magic Apple Events were still needed if I wanted write to new files from the sandbox.

But then I came up with a stupid idea. What if I made a new Apple Event, similar to the open document event, which instead of trying to open a file that doesn't exist… just did nothing? We'll call it "sandopen" and all it does it receives a file reference to a (non-existent) file that I'm about to tell Acorn to write to. In essence, it's saying "Here's a file reference that I want you to use your magic sandbox hole punching abilities on for me. Just ignore the fact that I'm not doing anything to it in this event, but rather the next one".

So the automator action sends that event to Acorn first and then tells it over Distributed Objects to save to the location.

And it worked!

So there's a handy little developer tip for you. I still hate the Mac sandbox.

October 8, 2015

While debugging a problem in Acorn yesterday, I came across a little oddity in Xcode that I thought was worth writing up for the greater good of my fellow Mac OS X developers. (Hey everyone- how's it going? iOS might get all the attention, but at least we can charge livable prices for our apps, amiright?).

Yesterday, Acorn had a bug where pasting a bitmap into an image would occasionally cause the bitmap show up as an empty layer. I could never get it to reproduce on my machine of course. I knew it was real though, I even had video evidence of it in action. It would not happen for me.

Then all of a sudden it did happen. And of course, I didn't have a debugger attached from Xcode so I couldn't break and see what the heck was going on. So I launched Acorn from Xcode, and tried to reproduce it. No luck.

Then it happened again, and I found a pretty reliable way to reproduce it. But again I wasn't running from Xcode and when I launched it from Xcode I couldn't reproduce it.

This shouldn't be happening. Why would the debugger "fix" this problem? Well, that's easy enough to test- I'll just turn off the debugger when running from Xcode. But then the bug didn't happen.

OK, so I was going down the wrong trail. It's not the debugger causing it. What else could be causing problems? Environment variables I turned on for debugging maybe? I checked the Run scheme to see if I had anything turned on there- and I did (Core Image flags), but turning those off wouldn't cause the bug to occur.

Maybe Xcode was setting an environment variable for me that I wasn't aware of? This was easily tested- I just added a couple of lines to Acorn to print the env vars, and compared the output from when I ran from Xcode vs. the Finder. One entry jumped out at me immediately- MallocNanoZone was set to 1 when run from Xcode, and it wasn't around when run from the Finder.

So I set MallocNanoZone to 0 in Acorn's Run scheme, launched Acorn from Xcode, and the bug reproduced right away. I had found what was masking the bug, and it was pretty easy to find the actual bug in Acorn after that.

So what does the MallocNanoZone env variable do? It's a flag that changes the memory allocator for your app, and for the frameworks your app uses. I don't know the specifics of this allocator vs whatever the normal one is, but I do know how it hid this bug from me in Acorn. When MallocNanoZone was set, the allocator worked in such a way that when I used CFRelease with a CGImageRef, and then used CGImageGetWidth with that same (bad) reference, it would return the correct answer (CGImageCreateCopyWithColorSpace() may have been involved as well). When MallocNanoZone was off the normal allocator was used and CGImageGetWidth would return a bad answer (as it should!). This bad answer caused Acorn to put the bitmap in the wrong spot and then the layer showed up empty.

Why does Xcode set MallocNanoZone=1? My understanding is that the Finder used to do this, so Xcode set the variable to behave the same as the Finder. However, I checked 10.8-10.11 and couldn't find any evidence of this.

TL;DR: If you're working on an OS X app, open up the run scheme and make sure to set MallocNanoZone=0 in your environment variables. If you don't, then you're using a different allocator than your users are, and behavior of your app might be different.

The fixes will be in Acorn 5.1.1 and 4.5.7, available now on the latest builds page.

Update October 12th:
So I was wrong about checking the environment variable to determine wether or not your process is using nanomalloc. The correct way is to do something like this in Terminal:

heap Acorn | grep MallocHelperZone

If you see output, nanomalloc is being used. If it's not there, then you're not. On my machine, when running Acorn from Xcode I can see that nanomalloc is being used by default. When run from the Finder, it isn't. A couple of little birdies have implied to me that this is an OS bug introduced in 10.11, and to expect a fix in the future along with a free 2016 WWDC ticket for me*.

* I wish. But hey— wouldn't that be cool? Apple gives out one WWDC ticket a week for the best bug found? I've long thought that Apple should add some sort of gamification to Radar.

September 29, 2015

It doesn't happen very often, but I'm releasing two updates to Acorn today: 5.1 as well as 4.5.6. If you're running the direct version, you can use the Acorn ▸ Check for Updates… menu item to grab the latest version. If you're using the App Store version, you're going to have to wait a bit for Apple to review and approve it.

First up- what's new in Acorn 5.1?
Some bug fixes, as well as minor compatibility fixes for OS X 10.11 El Capitan (most of the 10.11 fixes were in Acorn 5.0.1 already). But there are also some neat new features if you'd like to script Acorn from the command line, as well as Taptic feedback when aligning things to guides or canvas edges (this is available on 10.11+).

And another slightly big thing- basic SVG support. This has been a huge request for a number of years, and I'm happy to finally have something started for you in Acorn 5.1. Acorn doesn't support all the features that SVG provides (nor should it)- but it does a pretty decent job of getting vector objects and layers out of Acorn in a scalable format that'll be around for years to come. Look for more SVG improvements in future releases of Acorn as well.

And what's new in Acorn 4.5.6?
Compatiblity with OS X 10.11 El Capitan, and other bug fixes. Acorn 4 is still a great usable app- and we'd like to keep it that way.

We've also submitted Acorn 4.5.6 to the App Store- though it's been removed from sale. I've never tried updating an app that's been removed from sale, but hopefully it'll sail right through review without any problems.

September 14, 2015

Pieter Omvlee: The iPad Pro as a Greek tragedy:

"At this week’s introduction, two companies to centre stage at the iPad Pro’s announcement; Adobe and Microsoft. The choice made sense; both companies are known for making professional software and are actively developing software for iPad. But since Apple has made it basically impossible for smaller third party developers to have any stab at making serious software for the iPad, Adobe and Microsoft are also the only ones left in the arena."

Related: Why There’s No Sketch for the iPad