Keeping animated PNG iMessage stickers under 500KB
With the release of iOS 10, Apple introduced stickers in iMessage. A sticker is a small image or animation that can be sent or placed on messages, photos or on other stickers.
Keeping animated stickers below the maximum size of 500KB can be challenging. We'll show you how you can use TinyPNG to accomplish this! Read on!
Creating an iMessage Sticker Pack Application
First create a new Sticker Pack Application in Xcode 8. Select File > New > Project from the menu, then choose Sticker Pack Application.
Name your project and choose a location to save it.
Adding an animated PNG to your Sticker Pack
Your project is empty after creation. If you already have an animated PNG (APNG), you can drag and drop it to the sticker pack under Stickers.xcstickers > Sticker Pack.
For optimal performance, Apple has added a hard file size limit of 500KB for stickers. Xcode will warn you when you attempt to add a file that is larger.
Making sure your stickers are below 500KB can be especially challenging for animated stickers! Luckily you can use TinyPNG to compress your stickers.
Compressing animated PNGs
You can compress your images in order to reduce the file size. With the TinyPNG website you can compress APNG files for free. This allows you squeeze every last byte out of your images and to create the best possible stickers!
Compare before & after
The compression uses advanced techniques to compress images. The difference is hardly noticeable but the filesize savings after compression are quite spectacular. The APNG image of the waving panda is compressed from 1.5 MB to 492 KB. You can see there is barely a visible difference.
Note that animated PNGs are only displayed in Firefox or Safari. In Google Chrome, Opera, Microsoft Edge and other browsers you only see the first frame.
|Original APNG – 1.5MB||Optimised APNG – 492KB|
How to reduce file size further?
If TinyPNG is not able to compress your animated PNG below 500KB, you might have to take other steps to reduce the file size. You may have to change your image so that the dimensions are smaller, or use fewer frames.