Monday, March 03, 2008

More Gimp Goodness

I had some more CSS/HTML layout work to do the other day, which gave me the perfect excuse to write a couple more Gimp / Script-Fu scripts. These are all about being useful for me for specific tasks, rather than being general purpose scripts. Still, if you find them useful (probably more so as examples), by all means, use the code. Here's what I did:

  • utils.scm -Not actually a module, but a bunch of reusable functions I wish I had. For example, (selection-width img) returns back the width of the current selection. The trickiest one I created was (color->string c) which converts the color to an CSS/HTML style hex color. I love that I'm able to write these reusable functions, drop the file in my Gimp scripts, and bam, I have a reusable library.
  • css-info.scm - Creates a CSS Info plug-in. When invoked, it pops up a dialog box with the current selection and color choice in various CSS clauses (such as: background-color: #xxxxxx). I found this useful while working on a layout that called for absolute positioning. I would use the mouse to make a selection, hit a keystroke, and up would pop a dialog box with the info I needed to copy and paste into my CSS file.
  • export-selection.scm - Creates an Export Selection plug-in. You make a selection, invoke this filter, and it will create a new image, that's cropped, flattened and ready to save. This was useful for cutting out chunks of an image for layout purposes.

In general, I'll be publishing my Gimp scripts here.

No comments:

Post a Comment