Wednesday, August 19, 2009

Script-Fu: Save-It Plugin Improved

A while back I blogged about a Script-Fu plugin I wrote that simplified the saving of png files. The idea being that you edit and save your images as .xcf files and by hitting Control-P a PNG version is saved for you - no questions asked.

I've since improved this a bit to add support for saving a single region as png file with minimal hassle. The steps to do this reduce to:

  1. Create a selection (typically using the rectangle tool and guides to help)
  2. Hit Control+Shift+P
  3. Enter a suffix - for example: top
  4. Hit Enter

If the file above was named foo.xcf, the generated file would be foo-top.png.

The obvious use for this is extracting slices of images for web development. While I could have used the Slice or Guillotine plugins, I wanted something that was simpler and more precise.

Here's the code you'll need to drop into your scripts directory:

Here's the plugin in action:

2 comments:

  1. Hi there - I am trying this plugin, it looks perfect. I am on Gimp 2.0 on Windows XP. The key command Ctrl-Shift-P does not work but the filter is available under Filter. Hmmm.... also where does the image get saved to?

    ReplyDelete
  2. Gwilym -

    Glad the plugin is working (whew!).

    You'll want go to the Edit Menu, then select Configure Keyboard Shortcuts, and then find the plugin under Plug-Ins.

    Also, the image should be saved in the same directory as the original file.

    Come to think of it, if you don't have an original file (such as a .xcf file), I'm not sure where it gets saved.

    Hope this helps!

    -Ben

    ReplyDelete