Slashdot Mirror


Graphic Slicing with The Gimp?

Ivo asks: "I'm a webdeveloper working almost exclusively in Linux. But I currently still use Windows to use Adobe's ImageReady, to splice up the designs that we get from our webdesign partners. Usually, if someone asks 'can I do Adobe Photoshop stuff on Linux', the answer is of course, Gimp. Gimp rules. No doubt about that, and I use it all the time. But I miss the features that ImageReady has, like automatic generation of a lot of small images and buttons for a website, including mouseover and mouseoff variants. Doing that manually in Gimp or Photoshop takes hours. Is there a program for Linux, or even better a plugin for Gimp, that does what ImageReady does?" How difficult would something like this be to do using Script-Fu?

11 of 13 comments (clear)

  1. try python by DrSkwid · · Score: 3, Interesting

    and the PIL module

    you can even do it interactively

    python is cross platform too so your scripts won't be wasted if/wehn you move platforms

    I use it for generating thumbnails and <img> tags and whatever

    --
    There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
    1. Re:try python by DrSkwid · · Score: 3, Interesting

      quick cut and paste from the pythonware site

      Example: Create JPEG Thumbnails
      import os, sys
      import Image

      for infile in sys.argv[1:]:
      outfile = os.path.splitext(infile)[0] + "-thumb.jpg"
      if infile != outfile:
      try:
      im = Image.open(infile)
      im.thumbnail((128, 128))
      im.save(outfile, "JPEG")
      except IOError:
      print "cannot create thumbnail for", infile

      --
      There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
    2. Re:try python by WWWWolf · · Score: 1
      Example: Create JPEG Thumbnails

      I think ImageMagick will do this better: mkdir thn; cp *.jpg thn; cd thn; mogrify -format jpeg -geometry 128x128 *.jpg or something like that...

    3. Re:try python by DrSkwid · · Score: 1



      I think ImageMagick [imagemagick.org] will do this better

      better in that you can't even remember the commands ?:)

      personally the thumbnail example is a bit noddy

      My real script would shink the thumbnails to fit inside a bounding box and preserve their apsect ratio

      PLUS

      tag on a :
      print "" % (filename, img.width, img.height)

      and maybe even throw in some javascript

      show me image magik doing that and I'll be impressed

      --
      There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
    4. Re:try python by DrSkwid · · Score: 1

      oh ffs stupid bastard htmlfilter

      print "<a href='%'><img src='%' border=0 width='%' height='%' alt='%'></a>" % (filename, thumbfilename, img.width, img.height, 'thumbnail')

      --
      There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
  2. try checking our Gimp Script-fu by pwagland · · Score: 3, Informative
    Try checking out Gimp Script-fu or Gimp plugins.

    Or check to see if you have perl-o-tine installed. From the image, right click, filters/web/perl-o-tine... It is included in my SuSE install of gimp 1.2.2, bymmv. Perl-o-tine will split an image into a set of squares for you, I don't really know how to use guides, so at the moment I can only create nxn grids, however, each box can be of an arbitrary size. Doesn't really help with rollovers though.

    The rollover plugin may help more here, but I have never used it, so don't know how it works.

    Good luck!

    1. Re:try checking our Gimp Script-fu by Random+Walk · · Score: 1

      Actually perl-o-tine was one of the very few apps I have ever seen that completely locked up my Linux box - even login via ssh didn't work anymore, had to do a power cycle. After that, I rolled my own Perl script using ImageMagik. Things may have improved since then, didn't try the latest release of gimp.

  3. RTFM by Howie · · Score: 1, Troll

    I haven't used it, but a trivial google search found the GIMP Table Magic plugin in the gimp manual. That seems to do what you want.

    --
    "don't fall into the fallacy of believing that Perl can solve social problems. Maybe Perl 6 can, but that's a ways off"
    1. Re:RTFM by Howie · · Score: 1

      could whoever modded that as a troll please explain?

      I *did* do a simple google search, and *did* find the Table Magic plugin which appears to do exactly as requested, and *is* in the gimp manual. What's the troll? I don't normally care about moderation, but this is silly.

      --
      "don't fall into the fallacy of believing that Perl can solve social problems. Maybe Perl 6 can, but that's a ways off"
  4. Script-Fu yes, and Perl-Fu... by WWWWolf · · Score: 2, Informative
    Script-Fu is good for zillions of things, like automatical creation of whatever your heart desires.

    Of course, it's based on rather "limited" Scheme implementation. I'd recommend Perl-Fu - everything Script-Fu can do and more, in a vastly easier-to-debug environment.

    Neither of the languages are too hard, but Perl-Fu will be my favorite from now on.

    I have some example scripts in the web, too. In case anyone cares. Not much of Perl yet, but more than enough Scheme to confuse anyone =)

  5. Re:How to use guides by niklaus · · Score: 1

    There's an unlimited supply of guides hidden in the rulers at the side of the images. Just drag a few of them out onto the image.