News for hackers. Stuff that matters.
Re:Understanding the iPhone 6 Plus Screen by grey-area on Thursday November 20, 2014 @05:41AM (#8635142)
Make everything vectors.

IMHO this is what Apple should have done a long time ago, certainly on ios. Yes it has issues, but those issues are mostly faced by the OS vendor once, and have been successfully dealt with in the case of font rendering for example with antialiasing, hinting etc. You don't hear anyone decrying fonts being vector formats and asking to go back to pixel fonts nowadays, and resolutions are only going to increase.

The OS should be handling rendering, hinting, caching, raster representations based on vector data. As you point out this is a hard problem and Apple are uniquely qualified to handle it. Instead Apple have punted on this and developers are actively encouraged to produce raster representations of each asset which break for every new device which comes out (as you point out this doesn't just apply to fonts).

Controls like buttons or custom ones should be drawn in code, not included as raster assets, and the iconography for things like buttons, launch screens, branding or other app-unique assets could be stored as the original vector, as it should be. If you want to put a raster image on a button, well, sometimes that's not going to look good.

On top of the problems caused by resamping, what Apple have done instead of choosing the vector route is create an ever-growing headache for developers and themselves by focussing on raster assets and requiring pre-rendered bitmap reprentations of assets like icons, which usually start as vector anyway. How many different pre-rendered sizes of ios icon are we up to now, 20? Where does it end? This is not practical or forward looking, it's a hack which imposes real costs on developers, customers and Apple - there is a huge amount of work in creating and maintaining all the different launch screen, icon and other assets now required to be rendered at 3 or more different sizes for Apple devices, and this is bloating every single ios app with multiple megabytes of assets which could be generated on the fly from their vector representation, over the entire app store that alone is a huge waste of bandwidth for Apple and customers.

So there are lots of reasons to aim for real resolution independence, and from the point of view of developers, Apple chose a quick hack (which has devolved into a hacky mess over time), over a more difficult, forward-looking solution which anticipates that screen sizes and formats are going to multiply until it is impossible to cater to all of them with raster designs.

Re:Understanding the iPhone 6 Plus Screen by elo on Thursday November 20, 2014 @07:36AM (#8635411)
For what it’s worth, Xcode 6 allows you to provide a single PDF file per asset. Xcode will then render the PDF into bitmaps at all required sizes _at build time_ and include the rendered images in your app bundle. Of course, you will probably have to make a new build when new devices come out.

It’s not resolution independence, but it has the potential to make asset production much less painful. I don’t know if this approach also work for app icons or only for things like button and toolbar images.

Re:Understanding the iPhone 6 Plus Screen by grey-area on Thursday November 20, 2014 @07:54AM (#8635468)
Thanks, I didn't know that, I'll be exploring that feature, it'd be nice if they did that for icons - using a script to generate 20 different sizes is getting old. Unfortunately it looks like it is only supported for images at present.

Of course it'd be better if this was done at run time on the device, and bitmap representations cached as required (eventually they probably wouldn't be, even if initially they are).

Re:Understanding the iPhone 6 Plus Screen by ghshephard on Thursday November 20, 2014 @08:05AM (#8635503)
Apple is at least providing some tools to help with this - for instance, you can specify a storyboard whose initial view controller will then be used as the app’s launch screen; this avoids the problem of separate launch images for all screen sizes, resolutions and orientations their app supported.

http://oleb.net/blog/2014/08/replacing-launch-images-with-st...

I seem to recall Marco Arment took a bit of pride in having 100% procedurally generated graphics with overcast, so that he didn't have to create/ship any bitmapped images whatsoever.

Re:Understanding the iPhone 6 Plus Screen by notjosh on Thursday November 20, 2014 @05:54AM (#8635167)
It's relatively feasible today with (UI|NS)BezierPath and CAShapeLayer. It's not perfect in every situation, as CAShapeLayer is optimised for performance, but in the vast majority of cases it's worked well for me. Especially when paired with tools like PaintCode.

The tools are there by Apple, but I don't think the hardware until fairly recently could really justify the performance hit - instead choosing file size over performance. These days though, in the majority of cases, the performance hit is negligible (especially when compared to dev/design time of generating @3x assets years/months later)

Re:Understanding the iPhone 6 Plus Screen by grey-area on Thursday November 20, 2014 @07:13AM (#8635344)
It's relatively feasible today with (UI|NS)BezierPath and CAShapeLayer.

That's interesting, I might try that for launch assets, though it can't be used for app icons, I'd love to just drop in an svg and let the OS scale my icon.

Unfortunately the default path (including many default assets like icons and launch screens) is to produce tens of raster files generated from the original vectors and bundle them with the app which is wasteful, painful and prone to break with new hardware.

Re:Understanding the iPhone 6 Plus Screen by userbinator on Thursday November 20, 2014 @07:06AM (#8635322)
Effectively procedural generation of all the graphics, which could make for some tiny apps (see the demoscene for a great example), and it's certainly a great idea that should be used more, but there's still at times a need to get pixel-perfect images of the right resolution due to the horrible effects that resampling has on the edge-cases. Ultimately the display is still digital/pixel-based, not analogue/vector-based unlike how CRTs used to work; and many things we view on the displays, like photos, are still pixel-based.
Re:Understanding the iPhone 6 Plus Screen by grey-area on Thursday November 20, 2014 @07:11AM (#8635340)
It's certainly a trade-off, I wouldn't pretend otherwise, but the vast majority of assets I produce at least are vector, which are then translated to various sizes of bitmap image, which is wasteful, painful and ultimately futile as there are still issues whenever a new device comes out (like the iphone 6).

The pixels of the screen are now so small they have almost disappeared, so I think there's an argument we have reached the place where going mostly vector makes sense.

Clearly some assets will always be bitmaps (photos), but so many others are not well represented as bitmaps (icons, text etc) - content is fine as bitmaps but controls and chrome are usually better as vector.

Re:Understanding the iPhone 6 Plus Screen by leni536 on Thursday November 20, 2014 @01:14PM (#8637138)
Photos seem like good examples of pixel-based data but it's really not. They are really often rescaled by an arbitrary real number compared to the device pixel. Antialiasing hurts vector images much more often than photographs.
Re:Understanding the iPhone 6 Plus Screen by MrDosu on Thursday November 20, 2014 @11:41AM (#8636589)
This is very interesting. I did not know that raster images are still used.

Currently as a windows programmer I have not used raster images in years.