DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: wanted: way to batch/script manipulate image (ICO) files  (Read 7,285 times)

tinjaw

  • I'm so glad breakbeat techno isn't an illegal drug
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,927
    • Participated in NANY Challenge Twice
    • Coding Snacks
    • Military Service Badge - US Army
    • Linux User
wanted: way to batch/script manipulate image (ICO) files
« on: December 05, 2008, 03:40 PM »
I have a bunch of icons (.ICO) files that I need to create various colored set of. For example, all the icons are black on cyan and I need to make a black on red set, a black on green set, etc.

I am looking into the following:
  • python using Python Image Library (but it only handles ICO read-only)
  • python controlling Paint Shop Pro (but I don't own a copy of PSP)
  • using MS Paint, Ritalin, & caffeine

I was wondering if there is some magic tool I am overlooking.

[update]
It looks like GIMP is scriptable with python.
« Last Edit: December 05, 2008, 04:03 PM by tinjaw »

CWuestefeld

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,009
    • Participated in NANY Challenge Once
Re: wanted: way to batch/script manipulate image (ICO) files
« Reply #1 on: December 05, 2008, 07:09 PM »
I'd look at scripting ImageMagic. It's very high quality and can do pretty much everything you can imagine (assuming that you can figure out the arguments to send it).


scancode

  • I will eat Cody someday.
  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 641
    • Cody Award
    • Participated in NANY Challenge Twice
    • Coding Snacks
    • Furry Fandom Badge - Furry Fandom
    • DJ Badge - DJ
Re: wanted: way to batch/script manipulate image (ICO) files
« Reply #2 on: December 05, 2008, 07:27 PM »
I'd read the icon, edit it, save as PNG, and use PNG2ICO... :)

Edvard

  • Coding Snacks Author
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 3,027
    • Participated in NANY Challenge Once
    • Coding Snacks
    • Linux User
Re: wanted: way to batch/script manipulate image (ICO) files
« Reply #3 on: December 05, 2008, 08:23 PM »
1- Rip the icons: http://www.thugsatbay.com/tab/?q=other_tabiripp
2- Manipulate the png's with Gimp or ImageMagick or PIL (whichever works best and fastest)
3- Pack them back together with your favorite icon editor. I've been liking IcoFx lately.

If you want a command-line tool for the re-packing, Matthias Brenkmann's png2ico doesn't do 32-bit icons, so go to http://mattahan.deviantart.com/art/GANT-3-15364715 and download the icon package. Inside is a nifty utility named png2ico written by Andreas Verhoeven (of AveDesk fame...) that does 32-bit icons. It takes a trip through the help to get the hang of it, but basically it takes all the pngs in a folder and transforms them into bundled ico's at different sizes. The only drawback is it starts with a png and resizes, so start with the biggest one you can extract.
Here's the batch file I use. Just drop a file of 128 px pngs on the .bat :
Code
png2ico.exe -s 128 32bpp -s 64 32.bpp -s 48 32bpp -s 32 32bpp -s 24 32bpp -s 32 16bpp -s24 16bpp -s16 16bpp -i %1 -o %1\icons\
All children left unattended will be given a mocha and a puppy.

Edvard

  • Coding Snacks Author
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 3,027
    • Participated in NANY Challenge Once
    • Coding Snacks
    • Linux User
Re: wanted: way to batch/script manipulate image (ICO) files
« Reply #4 on: December 05, 2008, 08:44 PM »
Also, the IcoBundle utility can take multiple .ico files and "bundle" them together.
http://www.telegraphics.com.au/sw/#icobundle
All children left unattended will be given a mocha and a puppy.

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,888
    • Participated in NANY Challenge Six Times
    • Coding Snacks
    • Gathering Badge
    • Cody Award
    • Volunteers/Staff
Re: wanted: way to batch/script manipulate image (ICO) files
« Reply #5 on: December 17, 2008, 12:17 PM »
If you want a command-line tool for the re-packing, Matthias Brenkmann's png2ico doesn't do 32-bit icons, so go to http://mattahan.deviantart.com/art/GANT-3-15364715 and download the icon package. Inside is a nifty utility named png2ico written by Andreas Verhoeven (of AveDesk fame...) that does 32-bit icons. It takes a trip through the help to get the hang of it, but basically it takes all the pngs in a folder and transforms them into bundled ico's at different sizes. The only drawback is it starts with a png and resizes, so start with the biggest one you can extract.
Here's the batch file I use. Just drop a file of 128 px pngs on the .bat :
Code
png2ico.exe -s 128 32bpp -s 64 32.bpp -s 48 32bpp -s 32 32bpp -s 24 32bpp -s 32 16bpp -s24 16bpp -s16 16bpp -i %1 -o %1\icons\

Wow! Thanks! This is going to come in real handy for me. I can finally stop creating my icons from 99x99 256 color .bmp's and manually erasing the backgrounds. (that erasing can take a long time if the edges are not clean or it contains a drop shadow)

Original address: https://www.donationcoder.com/forum/index.php?topic=16035.0