Jump to content

Gimp Script for seperating images


Cannonfodder
 Share

Recommended Posts

I don't think this is gonna be possible, but then I suk with the gimp. I would think one scan qualifies as one image/file, regardless and would have to be separated manually.

 

Thinking in my photoshop ways, you would have to use the select tool and copy/paste into new image (which works with gimp too).

 

Then again, this is Linux and we do have people like aru :D

Link to comment
Share on other sites

Then again, this is Linux and we do have people like aru  :D
hehehe, thanks :D

 

But in this case I believe I'm completely unuseful:

 

I have a cannon scanner that I don't use under linux (well, I don't use it at all)

I have little expericence with gimp

...And I know almost nothing of perl which is (if I'm not wrong) the scripting language of gimp... or was it lisp... no idea :P

 

Said that, I'm sure there should be an script outhere for doing what you want.

Link to comment
Share on other sites

Not exactly what you want, but if all the scaned images contain two photos at the same postion, you can do:

 

for image in *;

do

    convert -crop 354x240+0+0 "$image" "${image%.*}_TOP.${image##*.}"

    convert -crop 354x240+0-0 "$image" "${image%.*}_BOTTOM.${image##*.}"

done

That will create an image_TOP.ext with the photo on the top of the scanned image, and an image_BOTTOM.ext with the photo on the bottom of the scanned image.

 

I'm assuming that the photos are 354x240 sized (I don't know the real value of your images, or of any photo :P). Also I'm assuming that the top photo is placed at the very left top (+0+0) and the bottom photo is placed at the very left bottom (+0-0).

 

Take a look to man: X, ImageMagick, convert,... Maybe there you'll find exactly what you want.

 

HTH :D

Link to comment
Share on other sites

    convert -crop 354x240+0-0 "$image" "${image%.*}_BOTTOM.${image##*.}"

 

I wrote the above message w/o testing it, and after sometests, I've realized that negative offsets doesn't work (despite of what the man page says), so in case your bottom photo is placed at left+bottom, you need to provide the number of pixels from the very top to the beggining of the photo, as:

 

    convert -crop 354x240+0+500 "$image" "${image%.*}_BOTTOM.${image##*.}"

 

(assuming that the bottom photo starts at 500 pixels from the top)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...