Why are iOS devices JPEG brain dead?|
(November 5, 2013)
The problem: Duckware produces an
HTML5 panorama viewer
and the quality of high-resolution
panoramas when displayed on iOS devices was very poor when compared to
every other mobile device out there (Android devices), and even worse
on Apple retina displays. But how is that possible? Seen right is an
example of the quality difference actually observed.
The issue is a KNOWN iOS Resource Limit: Apple itself
publishes the fact
that iOS devices have a severe resource limit in web pages, and therefore, are incapable of
displaying high quality JPEG photos:
"The maximum size for decoded GIF, PNG, and TIFF images is 3 megapixels
for devices with less than 256 MB RAM and 5 megapixels for devices with
greater or equal than 256 MB RAM." - apple.com
Just Google "iOS resource limit" and you
will find that this is a very well known problem with iOS devices!
What Apple does not disclose however, is that the limit is not enough
RAM in their mobile devices. Every other mobile device manufacturer
packs the maximum RAM possible into their devices, but not Apple.
An Example: Take a 5400×1000 pixel (5.1 megapixel) panorama. Because 5.1 MP is
above the iOS 'resource' limit (5MP in modern iOS devices, but 2MP in older iOS devices), iOS
behind the scenes reduces the size of that JPEG by half in the X direction AND half in
the Y direction -- and resizes the 5200×1000 5.1MP image to a 2700×500 1.3MP image.
BUT, it gets much worse: After doing extensive testing, it is clear that iOS can only
reduce (via subsampling) a JPEG in each direction (X/Y) by a power of two (2, 4, 8, etc).
That means that iOS can only reduce the megapixels in a JPEG by a factor of 4
(2×2), 16 (4×4), 64 (8×8), etc.
iOS can NOT reduce a JPEG by any other (non power of two) factor.
iOS is automatically (and without permission), discarding 75%, 94%, or 98% of the pixels
On a nice brand-new iPad Air, with a screen resolution of 2048×1536,
iOS is displaying a gorgeous 5.1 megapixel JPEG on a 3.0 megapixel retina
screen as an iOS-resized 1.3 megapixel JPEG.
YES, YOU DID READ THAT CORRECTLY, Apple is taking a 5.1MP photo, resizing that
to 1.3MP first, and then displaying that on a 3.0 MP display!
And to make matters worse, Apple's implementation has bugs that Apple refuses to fix.
This iOS 'resize' is supposed to be transparent to programmers (namely, image size
appears original, but is not; image quality is reduced). But it is not transparent.
Attempt to drawImage() the JPEG onto an HTML5 canvas, and the height of the JPEG
actually drawn will be 1/2, 1/4, or 1/16 (etc) what it should be! This bug was reported
to Apple against iOS 6. So is the bug fixed in iOS 7? NO! Apple programmers have
really screwed the pooch on this one.
Conclusion: iOS devices are JPEG brain dead! Apple has no common sense.
An iPad Air, with 1GB of RAM can NOT display a 5.1MP photo (in a web page), because Apple says,
that will use too many resources! Apple has intentionally hobbled the iPad Air from day one.