Post Reply 

Split Image Into Separate Images Via Selected Areas

Sep 3, 2014, 23:57
Post: #1
Split Image Into Separate Images Via Selected Areas
Hi,

Is there a way with gimp's equivalent of magic wand selection ( eg. selection snaps to different polygons in an image by color along different color borders or pixel "qualities"). And, now with that irregular (usually irregular) selection make that selection a separate image file. But yet that new image will remain intact within it's original (parent) image.?

For example get 50 (well 48 if it the continental USA) separate USA state JPEGs out of a well bordered and colored USA map but the whole map keeps it's original only now it's composed of separate JPEGS for each state. Is there a way?

Thanks
Find all posts by this user
Quote this message in a reply
Sep 4, 2014, 01:47
Post: #2
RE: Split Image Into Separate Images Via Selected Areas
Hi leegold,

I have read and re-read your message and I hope I understand your request...
I am going to assume you are new to Gimp and it is just the terminology you have used regarding 'separate images'.

Starting with your full map loaded as a single layer, make your first State selection.
Once you have your selection, you can copy (Ctrl-C) the selection and paste (Ctrl-V) it back into the same image as a new floating selection then choose Layer->To New Layer.
You will now have just that State on it's own transparent layer positioned as it was in the original layer.
Repeat for each State.
So now you have ended up with 50 or so layers in your single gimp .xcf file. (Which you can Save for use at a later date)
Then by toggling the visibility on the layers, you could then one by one per visible layer, File->Export creating a separate .png image per State. (.jpg files do not support transparency)

Alternatively, after selecting and copying each State, you could 'Paste As New Image' (Ctrl-Shift-V) ending up with 50 gimp .xcf files which you could also Export, however Gimp does not retain any information linking the separate State .xcf files back to the original.

Hopefully one of those solutions will do what you are trying to achieve, if not, please ask more questions...
Find all posts by this user
Quote this message in a reply
Sep 4, 2014, 04:21 (This post was last modified: Sep 4, 2014 04:39 by leegold.)
Post: #3
RE: Split Image Into Separate Images Via Selected Areas
(Sep 4, 2014 01:47)fluffybunny2 Wrote:  snip...
Alternatively, after selecting and copying each State, you could 'Paste As New Image' (Ctrl-Shift-V) ending up with 50 gimp .xcf files which you could also Export, however Gimp does not retain any information linking the separate State .xcf files back to the original.

OK, When I "paste as New Image" I'll get exactly the same map the only difference is each state will be a separate image file...that's what I need. I need the map of the USA looking exactly like it should but, each state is a separate image file. Is that possible?
Find all posts by this user
Quote this message in a reply
Sep 4, 2014, 05:35
Post: #4
RE: Split Image Into Separate Images Via Selected Areas
I'm following you instructions. I use the fuzzy select tool and it selects a state. I then copy and then paste the selection, I then do Layer->To New Layer like you said. I see a bounding rectangle arounf the state now. I then move the fuzzy select cursor to a different state but I can do it again. The second I go out of that new dashed line bounding rectangle ( for say Montana) the cursor changes indicating it can not select/execute it's function. So I can do it anymore after the first state.

Think I'm following your directions...is there a fix?

Thanks
Find all posts by this user
Quote this message in a reply
Sep 4, 2014, 06:43
Post: #5
RE: Split Image Into Separate Images Via Selected Areas
(Sep 4, 2014 05:35)leegold Wrote:  I'm following you instructions. I use the fuzzy select tool and it selects a state. I then copy and then paste the selection, I then do Layer->To New Layer like you said. I see a bounding rectangle arounf the state now. I then move the fuzzy select cursor to a different state but I can do it again. The second I go out of that new dashed line bounding rectangle ( for say Montana) the cursor changes indicating it can not select/execute it's function. So I can do it anymore after the first state.

Think I'm following your directions...is there a fix?

Thanks
You will need to re-select the layer that contains the full map by clicking on it in the Layers dialog, before trying to select the new state.
Find all posts by this user
Quote this message in a reply
Sep 4, 2014, 08:56 (This post was last modified: Sep 4, 2014 09:01 by rich2005.)
Post: #6
RE: Split Image Into Separate Images Via Selected Areas
A couple of plugins that might ease the process
These are both python plugins and go in your gimp profile for win C:\Users\your-name\.gimp-2.8\plug-ins

Layer via Copy/Cut http://registry.gimp.org/node/26396

Using fuzzy select has its drawbacks, if you want a boundary, then grow the selection by 1 or 2 pixels.

http://i.imgur.com/7L1QuFA.jpg

Apart from that the plugin makes a new layer with a single click. The layer is in the correct position, ie. has offsets and is sized as the selection bounding box.

http://i.imgur.com/mkdLy6P.jpg


Exporting, this plugin export layers as png does what it says, but you are going to have to rename each image from something-very-long.png to state.png No easy way of doing this. http://registry.gimp.org/node/18440
Why png? Because it preserves the transparency outside the shape boundary.

Use settings like this http://i.imgur.com/nXvZszE.jpg that will export any visible layers and number them accordingly

result. http://i.imgur.com/kpIZNIz.jpg

** https://www.gimp-forum.net/ now answering questions**
Find all posts by this user
Quote this message in a reply
Sep 4, 2014, 17:09
Post: #7
RE: Split Image Into Separate Images Via Selected Areas
I followed instruction and did it for two states. In a gimp window called layer-brushed I see pasted layer #1, pasted layer and usa.jpg . When I do shift-cntrl-v nomatter what I try I get the last state I cut-copied- layer->new layer in a new window that's titled "untitlted grayscale".

I am confused. What is the procedure?
Find all posts by this user
Quote this message in a reply
Sep 4, 2014, 18:29
Post: #8
RE: Split Image Into Separate Images Via Selected Areas
You sound very confused.

Here is a video that might help. Starts with the copy-paste into layers, second half demo's the plugins I referenced in that earlier post.

Is there a better way? Do not think so, whatever procedure is going to be tedious.

http://www.youtube.com/watch?v=ZUpIIWpM_ZU&hd=1 5 mins.

** https://www.gimp-forum.net/ now answering questions**
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Image centering for printing okfhp 1 16 Yesterday 17:51
Last Post: ofnuts
  "Open Image" change default folder and thumbnail view? Dave001 1 65 Aug 15, 2017 19:56
Last Post: ofnuts
  How to wrap paragraph text in an image arun67 0 52 Aug 12, 2017 12:46
Last Post: arun67
  Combining gif image to static image help? littlegreendog 1 81 Jul 26, 2017 12:27
Last Post: ythgilb
  Image color vs color picker YalithKBK 1 121 Jul 7, 2017 11:45
Last Post: ythgilb

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS