Hacker News new | ask | show | jobs
by ryanpetrich 5613 days ago
"The iPhone and iPad have to work a lot harder to display JPEGs than they do to display the equivalent PNGs"

That is a myth. It is the pixel format of the CGImage that matters, not the compression format of the source file. 32bpp premultiplied CGImages are the only format that the GPU will render natively as the contents of a CALayer. Since all JPEGs decode to 24bpp and most PNGs are saved as 32bpp, it's easy to see why this would be confused. Simply copying to a 32bpp CGImage is enough to make drawing quick again.

Coincidentally, this blog post also scrolls poorly on the iPad.

2 comments

The iPad (not sure about the iPhone) also has a JPEG hardware decoder. iOS 4.2 finally provided at least some level of access to this and it makes a huge difference.
Oh, that went public? I've been using it on the jailbreak side for ages :)

All devices back to the iPhone 3G at least have a hardware JPEG codec.

However PNG is much better than JPEG at rendering texts. So using JPEG for articles is ridiculous.