Saturday 30 August 2014

Android Icon Maker (free script for GIMP)

I discovered the joy of script-fu for GIMP today.

One thing I've found time consuming and irritating about android app developing is creating graphics for the various screen densities that are out there. Every graphic has to be created for the highest density, then scaled. Using GIMP for my originals, this previously meant I would have to scale the image, export the image, scale the image, export the image etc. until all drawable folders were populated with the icon. And if I then make a small change to the graphics, I have to repeat the process.

Then of course, there is still the task of putting the right file in the right folder with the right name.

So I discovered there is a script for GIMP  (specifically "script-fu-save-icons-png") available from the GIMP Plugin Repository (written by Jan Pavelka) that allows icons at multiple sizes to be created from the current GIMP image in one step.

That was great, but it didn't support all of the sizes I needed, and the images all had different file names (because the pixel size became part of the name). Plus, they still needed moving into sub-folders, so no major help.

I then decided to modify the script to suit my needs. I came up with the UI below, which I think would be helpful for other developers. The script gives an option of (currently) three different graphic sizes in dp units (suitable for launch icons, action bar icons, and notifications) and it allows a range of pixel densities to be specified.

When executed, it calculates the pixel size for each pixel density, and outputs the icon graphics (all with the same name) in the correct drawable subfolders for an android project.

Now with one press I can generate all of my icons from a single source file.

I've used this with much success on Float.

I will ultimately upload this to the GIMP Plugin Repository, but in the mean time it can be sourced from here: script-fu-android-icon-maker.scm


1 comment:

  1. This is my first time visit here. From the tons of comments on your articles,I guess I am not only one having all the enjoyment right here! read

    ReplyDelete