Graphic Slicing with The Gimp? 13
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?
try python (Score:3, Interesting)
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
Re:try python (Score:3, Interesting)
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
Re:try python (Score:1)
I think ImageMagick [imagemagick.org] will do this better: mkdir thn; cp *.jpg thn; cd thn; mogrify -format jpeg -geometry 128x128 *.jpg or something like that...
Re:try python (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
Re:try python (Score:1)
print "<a href='%'><img src='%' border=0 width='%' height='%' alt='%'></a>" % (filename, thumbfilename, img.width, img.height, 'thumbnail')
try checking our Gimp Script-fu (Score:3, Informative)
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 [gimp.org] may help more here, but I have never used it, so don't know how it works.
Good luck!
Re:How to use guides (Score:1)
Re:try checking our Gimp Script-fu (Score:1)
RTFM (Score:1, Troll)
Re:RTFM (Score:1)
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.
Script-Fu yes, and Perl-Fu... (Score:2, Informative)
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 [www.iki.fi], too. In case anyone cares. Not much of Perl yet, but more than enough Scheme to confuse anyone =)