MapKit overlay tip

  • Just wanted to pass on this little pearl I just discovered in the case that it might help someone else.

    I've got a bunch of images that I'm using as mapKit mapView overlays for iOS devices and of course was interested in having them be as small as possible and load as fast as possible.

    So, I took all the PNGs and converted them to JPEGs at varying compression sizes and got them nice and small.

    Map drawing time went up terribly and the images and maps started slowly chunking in on the devices.

    Don't use JPEGs.  Use PNGs.  it's a world of difference in map drawing performance.

    Hope this tip/warning helps someone.

    Cheers,
    - Alex
  • On 5/22/12 12:52 PM, Alex Zavatone wrote:
    > Just wanted to pass on this little pearl I just discovered in the
    > case that it might help someone else.
    >
    > I've got a bunch of images that I'm using as mapKit mapView overlays
    > for iOS devices and of course was interested in having them be as
    > small as possible and load as fast as possible.
    >
    > So, I took all the PNGs and converted them to JPEGs at varying
    > compression sizes and got them nice and small.
    >
    > Map drawing time went up terribly and the images and maps started
    > slowly chunking in on the devices.
    >
    > Don't use JPEGs.  Use PNGs.  it's a world of difference in map
    > drawing performance.
    >
    > Hope this tip/warning helps someone.

    Note that as part of the build and bundling process, Xcode runs PNGs
    through pngcrush, which does a variety of optimizations that reduce file
    size and, I believe, do some hardware-specific decoding optimizations.
    The upshot of this is that a comparison of raw PNG and JPG files is
    totally meaningless; you would have to actually look at the
    post-pngcrush output, and even this wouldn't tell the whole story.

    If you are doing performance tuning, you should take a look at the
    pertinent documentation (e.g.
    https://developer.apple.com/library/ios/#documentation/iphone/conceptual/ip
    honeosprogrammingguide/PerformanceTuning/PerformanceTuning.html
    ).
    There and in other docs Apple explicitly notes that PNG is "the
    preferred image format for iOS apps."

    (Something I hadn't really thought about is that this would suggest
    different performance for PNGs that are downloaded by an app versus
    those that are included at build-time.  Does anyone know whether there
    is a noticeable difference?)

    --
    Conrad Shultz

    Synthetiq Solutions
    www.synthetiqsolutions.com
previous month may 2012 next month
MTWTFSS
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
Go to today