buildset.py (Python iconset builder)

Various Stuff

Source i (link to git-repo or to original if based on someone elses unmodified work):

Add the source-code for this project on opencode.net

0
Become a Fan
5.0

Description:
This is mainly for iconset authors, but users may also want to use this to build iconsets more efficiently.

I grew impatient with the Bash scripts that are often included with iconsets here at kde-look. I also happen to be learning Python so I took a stab at writing a buildscript in Python for fun and to see if there would be any differences between Bash/convert and Python/PIL. This is what I found on my machine (1.7G Pentium 4, 512 RAM) using 3 different iconsets:

Dark-Glass:
http://www.kde-look.org/content/show.php/Dark-Glass+reviewed?content=67902

buildscript.py:
5m17s
66M Dark-Glass-2.4.tar.bz2
98M Dark-Glass - uncompressed

buildscript.sh:
18m47s
125M Dark-Glass.tar.bz2
165M Dark-Glass - uncompressed

Leopard-Style:
http://www.kde-look.org/content/show.php/Leopard-Style?content=71732

buildscript.py:
1m9s
12M Leopard-Style-0.4.tar.bz2
22M Leopard-Style - uncompressed

buildscript.sh:
4m34s
24M Leopard-Style.tar.bz2
38M Leopard-Style - uncompressed

Breathless:
http://www.kde-look.org/content/show.php/Breathless?content=60465

buildscript.py:
11m21s
135M Breathless-1.1.tar.bz2
204M Breathless-1.1 - uncompressed

buildscript.sh:
33m42s
268M Breathless.tar.gz - included script used gzip instead of bzip2
336M Breathless - uncompressed

One main difference between buildscript.py and buildscript.sh is that buildscript.sh uses convert from ImageMagick which when resizing 8-bit icons it converts the icons to 16-bit. This increases the time in conversion and space in storage, but there are no gains because you can't get any more information from 8-bit to 16-bit conversion. I carefully looked at the icons and I see no difference between them. The 16-bit conversion would only be valuable in converting from higher bit or raw images, not lower bit images.

Please give this script a try and please tell me if I am wrong.

REQUIRE

Python-2.5.1
Python Imaging Library-1.1.6
Versions are only tested versions, other versions may or may not work.

ImageMagick's convert for the odd .xpm file.
Last changelog:

0.3:
Fixed a few errors and tidied up the code.

0.2:
A little more intelligent, thus a little more flexible. It'll play nice with more iconsets out there, including any that have unusual directories within 128x128 or 32x32 directories, i.e., categories, emblems, emotes, etc. The variables in the script are dynamic rather than static as they were before.

Converts .xpm files to .png prior to resizing because PIL can't handle them, .xpm files are left intact, however.

Added some error reporting, including a text file listing, if any, icons that failed to resize for whatever reason.

Gives user the option of resizing actions icons to 32x32 and smaller in the interest of saving space and faster building.

Disregards hidden files now, i.e., '.dolphinview' and '.DS_Store'.


Ratings & Comments

6 Comments

mentalrey

Many many TKS for the script , you are a genius. Prox release of Dark-Glass implement it. p.s. i know to do a script like a fish know to do equations (anyone have is job) ;-)

LocoMojo

Cheers Mentalrey, glad you found it useful. It's the least I can do in return for your awesome iconset! I only wish I could do more. LocoMojo

LocoMojo

...sorry about the double post. LocoMojo

sceazy

Very nice, it seems to produce much clearer icons at at smaller sizes, good job.

LocoMojo

Thanks. I can especially see some faster degradation in the 16-bit icons converted from 8-bit than the 8-bit to 8-bit icons so there is definitely some differences. This script provides faster building, less space used in storage, and less degradation in the icons. I only did this for fun and I was pleasantly surprised at the result. Hope someone out there finds this script useful. Cheers, LocoMojo

LocoMojo

Thanks. I can especially see some faster degradation in the 16-bit icons converted from 8-bit than the 8-bit to 8-bit icons when I enlarge them to get a closer look so there are definitely some differences. This script provides faster building, less space used in storage, and less degradation in the icons. I only did this for fun and I was pleasantly surprised at the result. Hope someone out there finds this script useful. Cheers, LocoMojo

Pling
0 Affiliates
Details
license
version 0.3
updated
added
downloads 24h 0
mediaviews 24h 0
pageviews 24h 0

Other Various Stuff:

meteo-qt
dglent
last update date: 3 years ago

Score 7.2

msfonts
aviram
last update date: 23 years ago

Score 5.0

new keramik? drop shadows? now?
sheean
last update date: 23 years ago

Score 5.0

KDE 3.0.4 Up on German KDE FTP
DecayingOmega
last update date: 22 years ago

Score 5.0

kbfx for debian sid
rufuseddy
last update date: 20 years ago

Score 5.0

Linuxfans Website
connermo
last update date: 22 years ago

Score 5.0