TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Python script to generate IOS icons

2 pointsby hanscover 12 years ago
Starting with IOS development, I was looking for a way to generate icons in various sizes as required by apple. I couldn't find anything quickly, so I hacked together a Python script. Here it is:<p>[code]<p>from PIL import Image import glob, os<p>sizes = [57, 114, 72, 144, 512, 1024]<p>for infile in glob.glob("*.jpg"):<p><pre><code> print("File: " + infile) if "_" in infile: continue file, ext = os.path.splitext(infile) for size in sizes: print("=&#62; New size: %dx%d"%(size, size)) im = Image.open(infile) im.thumbnail((size, size), Image.ANTIALIAS) im.save(file + "_" + str(size) + ".png", "PNG")</code></pre> [/code]

no comments

no comments