title: WebP image format on iOS
body: <p>I’m currently researching the possibility to use Google’s WebP image format in our iOS software.</p>
  
  <p>I found it’s not hard to decode the WebP into RGBA8888 as needed using the Google’s C-library.</p>
  
  <p>However, I’d like to create an implementation comparable to UIImage in terms of both API and performance.</p>
  
  <p>Q1. Is it possible in iOS to develop an image decoder so that native imageWithData and other APIs will read the new format?</p>
  
  <p>Q2. If no, what API does UIImageView (and other framework-provided controls) use to draw the UIImage? Is it public (e.g. drawInRect/drawAtPoint) or internal?</p>
  
  <p>Can I inherit from UIImage, override a few methods (such as +imageWithContentsOfFile, +imageWithData, +imageNamed, -drawInRect, -drawAtPoint), and have my WPImage objects behave well with SDK-provided APIs?</p>
  
  <p>Q3. If every instance of my hypothetical WPImage class will subscribe for UIApplicationDidReceiveMemoryWarningNotification (to flush RGBA image buffer leaving the much smaller original WebP data in RAM), won’t it hurt the performance much?</p>
  
  <p>The software we’re developing may easily have hundreds of different images in RAM.</p>