Inkscape.org
Beginners' Questions Extracting overlapping sections of Bitmap image
  1. #1
    DevonMist DevonMist @DevonMist

    I want to set up a repeatable method for extracting shapes from jpg (bitmap) images - along the lines of the example below.

    In this example the best way I can find at present is to duplicate the image three times and then use Object > Clip > Set to extract each individual section.

    I have a feeling that there must be an easier way to do this?

    Thanks for any help!

    Extract
  2. #2
    Polygon Polygon @Polygon🌶

    I don't think there' s an easier more effective way - please keep in mind that this method is non-destructive while you have to copy&paste even in an raster graphics editor for example. What kind of idea do you have in mind that might work faster more efficient?

  3. #3
    inklinea inklinea @inklinea⛰️

    If you are using Linux, this thread has a simple bash script half way down to extract in the way you want.

    https://inkscape.org/forums/beyond/multi-step-export-from-command-line-clipping-a-front-image-to-several-objects/#c22934

  4. #4
    DevonMist DevonMist @DevonMist

    Hi 

    Thanks for the responses. 🙂

    @PixelPest - I really do not have any idea in mind of what could be faster or more efficient. I was hoping that there may be a way to avoid all the duplication of the base image but I am no Inkscape expert so was not sure if there was a more elegant solution!

    @inklinea - I missed that thread on my search of the forum earlier. That looks perfect but unfortunately this needs to be a solution that I can explain for Windows users as well so that they can use a imprintable product that we will be offering in the future.

     

  5. #5
    Paddy_CAD Paddy_CAD @Paddy_CAD

    Perhaps the Layer Clip Extension will meet your needs.  By coincidence I just came across this discussion in the extensions forum.  

       https://inkscape.org/forums/extensions/layer-clip-updated-to-100-not-working-in-102/
       https://gitlab.com/jczapla79/inkscape-extension-layer-clip
       http://www.pernsteiner.org/inkscape/layerclip/

    I haven't used it but judging by the forum, it's the bee's knees.  The comments range from enthusiastic to rhapsodic.  If you test it, let us know how you get on.  I'll probably try it out myself just to see what the excitement is about.

  6. #6
    DevonMist DevonMist @DevonMist

    Thanks Paddy.

    I'm not at the correct computer at the moment but I will definitely have a look at it this evening. I will report back!

  7. #7
    DevonMist DevonMist @DevonMist

    @Paddy_CAD - I've had a proper read of the forum posts that you linked to and I think that asking others to download a script is probably going to be more complicated than it need be for what I need them to be able to achieve. At most they will probably need to extract around 12 'clips' from the base image so the method I've already come up using the duplicates will probably be sufficient. 

    It's certainly something I will try at some point though when time allows.

  8. #8
    Xav Xav @Xav👹
    👍

    My advice would be to clone (not duplicate) the image, then put the original version into a group (yes, a group of just one object) before you clip it. By doing that the clipping path is applied to the group rather than the image itself, so the cloned versions remain unchanged. You can then clip them individually (though there are also benefits to putting them into groups first, see below).

    This approach means that there's only one copy of the image embedded (or linked) in the SVG file, so although it's not any faster in terms of the work you have to do manually, the file is less bloated as a result.

     

    Personally I think it's a good idea to always put a bitmap image (or its clone) into a group before clipping (or masking) it. That way you can double-click to enter the group and adjust the position or size of the image without having to unclip then re-clip.

     

Inkscape Inkscape.org Inkscape Forum Beginners' Questions Extracting overlapping sections of Bitmap image