gotcha

Author Topic: Cropping and removing  (Read 596 times)

June 17, 2019, 10:26:32 AM
Read 596 times

toxicdafi

  • Sr. Newbie

  • Offline
  • **

  • 2
Hi,

The image cropping tool does not remove the rest of the image (the layer is still present) but I would like that to be the case, because my svg file is way too large, how can I do that?

(My image is 2048x2048, each pixel being a 255-gray level)

Thank you !
  • 0.92
  • Windows

June 17, 2019, 01:39:39 PM
Reply #1

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Welcome to the forum!

I can't quite tell if you aren't familiar with vector graphics, or maybe you just haven't learned the terminology yet.  Inkscape doesn't have a cropping, it has clipping, and you have indeed discovered how it works.  It's not supposed to remove anything, just "hide" it.

It's the part where you mentioned the color of the pixels that makes me wonder if you realize that inkscape is a vector graphics tool.  In vector graphics, pixels are irrelevant (there are no pixels, unless you have imported a raster image).

So if you have a raster image (PNG, JPG, GIF, TIF, etc.) and you want to crop it, you should use a raster editor.  GIMP is a free and open source raster editor.

If it's a vector image or you still want to try and use Inkscape, there is an extension called "Destructive Clipping" which as far as I understand, does remove the unwanted parts.  It needs to be installed, and the last report I heard, it wasn't working (although I wasn't able to confirm that - I just heard it).  If you want to try it, you can download here:  https://github.com/funnypolynomial/DestructiveClip  And if you don't find instructions for installing it there, these are instructions for installing it:  https://inkscape.org/learn/faq/#how-install-new-extensions-palettes-document-templates-symbol-sets-icon-sets-etc  If you need more detailed instructions, try the Home tab above, and look at the bottom half of the page.

Let us know how it goes  :)
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

June 17, 2019, 07:30:58 PM
Reply #2

flamingolady

  • IC Mentor

  • Offline
  • ******
  • Flamingo Lady

  • 154
  • Gender
    Female

    Female
Or, perhaps using path difference might have the intended end result you are looking for.

There is a manual way to resemble cropping - and that's to do Object>Pattern>Objects to Pattern.  Then you, for example, make a box  to work with (about the same size as your orig design), use the fill n stroke, select your pattern.  It fills the box with your design.   Add bunches of nodes, then adjust each node to 'crop' out the sections you don't want.  (better explained in the manual).  Good for some things, not so much for other things. 

June 18, 2019, 12:35:56 AM
Reply #3

toxicdafi

  • Sr. Newbie

  • Offline
  • **

  • 2
Thanks for your quick and detailled response !

So,

- I tested the Destructive Clip, it's not working, there's a bunch of python errors, and I don't know a thing about Python ( 0:) )

- Yes, my image is a raster image, attached an example (in .png, but my images are .tiff) of what I'm doing. I have Gimp so I can use that to crop it, thanks ! But ...

- flamingolady, Your solution proposal works perfectly! I didn't even have to add any nodes, I just took the same box.

Thank you both of you for bringing good answers :)

EDIT : flamingolady, I did what you propose, but the svg size is still the same .. It seems that the objet pattern keeps the entire image, even if I take only a part of the image.

RE-EDIT : I will use gimp I think, but it is sad I'm not able to do this with Inkscape !
« Last Edit: June 18, 2019, 01:32:37 AM by toxicdafi »
  • 0.92
  • Windows

June 18, 2019, 05:08:09 AM
Reply #4

Moini

  • IC Mentor

  • Offline
  • ******

  • 1,568
    • VektorRascheln
flamingolady, unfortunately,Path > Difference will not work with a bitmap image, nor will converting to a pattern reduce the file's size. The only way to achieve the result the OP asks for is to crop the picture before embedding it into the SVG file.

June 18, 2019, 06:50:37 PM
Reply #5

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Now that we know the image is a raster image, I'm not sure if the Destructive Clip extension would have worked on it anyway.  I don't know for sure though.

Hmmm, depending on how you're going to use the final image, it might work to set the page size to your desired image size.  In certain situations, only the part inside the page border will be displayed.  Of course, that doesn't get rid of the outer area either.  But in some situations, it would effectively get rid of it.

For example, if you were going to put it on a webpage, you could set up your desired image size in the html code (sorry, I can't remember the html terminology at the moment).  And even though the image is still the full size, only the part inside that defined coded area will show.

Or using the image in certain programs might only display what's inside Inkscape's page border.

Well, just a thought.  At least you can get the job done elsewhere. 

  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

June 18, 2019, 09:43:40 PM
Reply #6

flamingolady

  • IC Mentor

  • Offline
  • ******
  • Flamingo Lady

  • 154
  • Gender
    Female

    Female
Yeah, I wasn't entirely sure if it was raster or not.  Gimp is good for cropping.  I will often crop and/or resize there, then import it back to Inkscape to work with. That might be your best option.
I'm just thinking here - wonder if tracing bitmap would work, not my forte, and don't know if you can re-size to get a smaller file...  I don't really care for tracing myself, maybe someone else can answer that.

June 19, 2019, 05:09:55 AM
Reply #7

Moini

  • IC Mentor

  • Offline
  • ******

  • 1,568
    • VektorRascheln
Whether bitmap tracing would work well or not depends on the picture. Cartoon- or logo like stuff works well, photos won't.