Alexander Sergeev's blog

The New iPad and indexed PNG

I discovered a strange bug with indexed png on the new iPad (aka iPad 3) and I wish to share my knowledge.

The problem was the strange line at the bottom of the image on retina (@2x) image in indexed png format. Here is the graphical explanation of a problem:


The black line is not a part of image itself; it is an artifact of the New iPad drawing subsystem (CoreGraphics?). The worst thing that in the Simulator  everything looked fine, and I have no the New iPad to test on… So some time passed before I figured out what was happening. I replaced images by RGB png (thank you, ImageMagick!) and everything was OK.

To convert indexed png into RGB png install ImageMagick (via ports):

$ sudo port install imagemagick

and use script (it takes all PNGs in the current directory, converts them into RGB and also removes alpha channel by making background white):

#!/bin/bash
for f in *.png
do
filename=$(basename "$f")
extension=${filename##*.}
filename=${filename%.*}

echo converting ${filename}.$extension
mogrify "./${filename}.$extension" -type TrueColorMatte -background white -flatten +matte  -type TrueColor -define png:color-type=2 -depth 8
done
Share

Mac OS X Lion

To represent the user experience after update up to Mac OS X Lion imagine someone switched brake and accelerator pedals in your car

Share

Small investigation

I made a small investigation of iOS device and version usage.

I did not count devices older than iPhone 3G and iOS older than 3.2, but according to http://www.marco.org/2011/08/13/instapaper-ios-device-and-version-stats-update their part is lesser than 2%.

Here are the results:

iPhone devices statistic:
iPhone devices statistic

Only 6% users use iPhone 3G and 2-th generation iPod and the major part (3/4) maiden up by iPhone 4/iPhone 4S.

iOS version statistic:
iOS versions statistic

Almost 3/4 of users switched to iOS 5 as well.

So I think that the conclusion is simple: if you are not Facebook or Google and if you have no enough resources to support older iOS version, drop of the support of old devices and iOS version. Do not waste your time and efforts to support iOS older then 4.0 and to optimize your code to run smoothly on device older than iPhone 3GS. Or read this perfect article by Joel about drums and software optimization.

I picked up and accordion and do not regret.

Share




Forgot?
Register
Facebook login by WP-FB-AutoConnect