Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Split image into its parts
#1
Is it possible to export the different pieces of a selection into PNG images or put it at once in a new layer for each ?

Let me detail below what I'm trying to do.

1. Open image like the attached picture
2. Select white background
3. Invert selection
4. Grow selection by 20px

The next step is to save the different pieces into separate images. Is it possible to do it with Gimp ?


Attached Files Thumbnail(s)
   
Reply
#2
Guessing, originals are larger than given sample and you have many to process.

Some magic that will intelligently hop from selected area to selected area and copy to a new image?
From your procedure that is one selection and is treated as such.

If the small sections were more uniformly distributed then setting guides up and Image -> Transform -> Guillotine into layers works....but in this case some will be bisected (and do you need the serial numbers?)

screenshot. https://i.imgur.com/rCuzciP.jpg

Then select, copy, paste-as-new-image for the troublesome areas.

Nothing else that I know of that works with a Mac.
Reply
#3
I have a script (ofn-extract-objects) that can extract the non-transparent areas of a layer and save them to file or to independent layers. It will work with irregular shapes, even if the bounding rectangles of the shapes overlap.

But to use it, you have to isolate each piece, and given that the background is non-uniform and some of the fragments are very light, I don't see any fully automated way to do so. But at least the script will save you the drudgery of extracting each object to its own layer/file.
Reply
#4
As a re-look, not impossible using a plugin g'mic http://www.gmic.eu The snag is using a Mac. The alternatives for that plugin are: compile it yourself, find a pre-compiled version that works with the many flavours of OSX/Gimp, use a gimp that already includes gmic.

Similar to an earlier post which divided up a page of cards, with the big difference being the non-regular image placement. This does make any automation for many pages a problem.

Add an alpha-channel, erase lines between the images https://i.imgur.com/A1fmCV1.jpg
Run the gmic_gimp plugin, which gives a preview how it divides up. https://i.imgur.com/l36reAL.jpg
That gives a new image with layers, then one of the several scripts that writes the layers to individual images. https://i.imgur.com/nzvMOPj.jpg and one of them open in a viewer.

That is the bare bones which only takes a couple of minutes, a bit of pre and post processing gives a more consistent result.
Reply


Forum Jump: