Category Archives: Tools
Removing alpha channel of pngs using Imagemagick
Apple has released new version of iTunes Connect and you would get an error message when try to send images on iTunes Connect for apps.
It would tell you that “Invalid Icon” balabala “xxx.png with an alpha channel. Icons should not have an alpha channel.” and so on.
You can check your pngs to see whether it has an alpha channel.
find . -type f -name "*.png" -exec identify -format '"%d/%f" %[channels]\n' {} \;
And you can remove their alpha channel to make apple happier.
find . -type f -name "*.png" -exec mogrify -background white -alpha off -flatten {} \;
You’d better run it in the specific directory so that you can limit the affect.
That’s all.
WGS84 to China
All maps in China are transformed for some reasons, the map providers are forced to add some noises so that all points are somehow offset. Chinese call this Mars Coordinate System for fun.
I wrote an api for translating the mars’ coordinate, you can request http://chillrain.com/api/wgtochina.php?latlng=50.926888%20116.391046.
Don’t do it too frequently, it has a request limit.
So welcome to the mars!
Beijing Air Quality
Here is a page for beijing air quality, the data are from U.S. Embassy Beijing China and the graph is drew by raphael.
The air is “crazy” enough to draw a beautiful curve.