Learning Sikuli to automate image resizing

Hey haven't posted here in a long time. I've been busy elsewhere and not have anything of high quality to show on this blog. But the following may be helpful for some people who wants to automate some processes in Seashore, which is a very basic graphic software (a primitive GIMP that runs natively in mac) that doesn't have action capabilities.

Recently I learned about Sikuli: "A visual technology to automate and test graphical user interfaces (GUI) using images (screenshots)." It's not as precise as Mac's Automator or some other batch action process, simply due to the variability of how the interface elements look in different environments (i.e. your menu bar might be blue, gray, brown, etc.). But with a different way of thinking about repeating your onscreen action, you may be able to solve tricky automation puzzles. For example, I never figured out how to make Automator do the following (even tried letting it record every step, but it's not generic enough to handle all cases).

Below is my Sikuli script cobbled together within 24 hours after learning about it.


The automation script looks at all currently opened image file in Seashore, then for each one, proceeds to:
1. change image mode to Grayscale
2. change resolution to 72 dpi
3. change width to 500 pixel, make sure height is automatically recalculated
4. save image
5. close current image

No comments:

Specific RSS Feeds: Cards | Work-in-Progress | Animation