Hello,
Often I need to remove background from photo/raster or vector. I wanted to know what is the most efficient way to do that. Here's how I do it if it's photo:
1. Use Rectangle Select or Ellipse Select to select areas around object to remove first.
2. Use Eraser to remove small areas of background until all around object is clean.
Sometimes I would select Fuzzy tool to delete areas with same color but in photo/raster images it's hard to target.
In vector file, I would no need to remove background selection by selection because Fuzzy tool can select background which happens to be of same color and I can remove background. Depends on vector too of course because with manually converted photo to vector the background would still have variety of colors from conversion.
Here's my current image that was converted to vector. I am trying to find a faster way to remove background.
What would be your advice?
[
attachment=1049]
There isn't a single method that suits all images. Each image must be considered on its own.
The attached image has these problems:
1. The background has been partially cleared.
2. Some background colours match the image colours - always difficult
3. The attached image doesn't have any transparency - it is a screen print
Can you post the original unedited image (or a representative sample)?
Is the original bitmap or vector?
Why convert to a vector? What are you using, Inkscape?
As a raster image in Gimp using stock Gimp tools.
The fore ground select tool would work.
or
Create a path, then path to selection is not difficult.
Third party tools, I like the gmic plugin
http://www.gmic.eu and the interactive extract filter
Left-click (green ) for foreground, right-click (red) for background
https://i.imgur.com/yG5Ar41.jpg
Separates like this
https://i.imgur.com/rbqWDt1.jpg (changed my checker pattern to differ from your screenshot)
(12-04-2017, 04:27 PM)rich2005 Wrote: [ -> ]Why convert to a vector? What are you using, Inkscape?
Because I thought raster images are harder to be printed on fabric. I heard the less complex is design, the more likely it will come out properly. Say, if raster image is a photo of animal made with digital camera, what DPI should it have normally? Or DPI is not important? I heard DPI should be 150 for print at least.
Yes, I used Inkscape for vectorization but I think result could be better. I didn't play with settings a lot.
(12-04-2017, 07:08 PM)TechnicGeek Wrote: [ -> ]Because I thought raster images are harder to be printed on fabric. I heard the less complex is design, the more likely it will come out properly.
I dont understand the ideas you have about printing and vectors, but i can assure that tracing an image in Inkscape does not produce an accurate replica of the raster image you used.
In fact you can get nice effects by tracing a raster image, because shapes get more rounded or are joined at very small scale but thats a different matter.
Also with lots of colours, tracing can lead to very complex files, which will slow down your computer.
Plus: cleaning up complex vectorfiles takes aaaaaages. Deleting and moving hundreds of nodes.
@TechnicGeek
That is interesting. Taking the pixels-per-inch (ppi = dpi) first. This is important for printing. Photographs on photo paper, usually 300 ppi is used. For printing on fabric, I think a smaller value could be used maybe 150 to 200 ppi.
The photo you get out of your digital camera is probably a jpeg image. The main property is the image size in pixels. Open the image in Gimp and that size is top of the Gimp window. Look in the menu Image > Print size and there will be a ppi value. You check that, but the main one is pixel size. Gimp works in pixels.
The main reason for converting to a vector image is for scaling. A vector image can be scaled up or down without loss of quality. Especially useful for small simple images with few colours where scaling up in Gimp results in loss of definition/quality.
Not so useful if the image is already a large size and is more complicated.
Converting to a vector will usually reduce the number of colours and simplify shapes, That might be a good thing for printing on fabric.
As an example going through the stages
This using the gmic plug-in I mentioned earlier to remove the background:
https://i.imgur.com/iTQ7apU.jpg
Exported from Gimp as a png then into Inkscape to trace. Note that the number of scans is 10, so I will get 10 colours.
https://i.imgur.com/Ei4TU6K.jpg
Now if I save that as a vector svg file, I can open-as-layers in Gimp set the values to match the canvas I made for it and set the size to whatever is required:
https://i.imgur.com/SZYR8VQ.jpg
(12-04-2017, 09:00 PM)rich2005 Wrote: [ -> ]Converting to a vector will usually reduce the number of colours and simplify shapes, That might be a good thing for printing on fabric.
You can get the same with Indexed Colours in Gimp.
Or maybe using an ICC profile ?
(12-04-2017, 04:27 PM)rich2005 Wrote: [ -> ]Third party tools, I like the gmic plugin http://www.gmic.eu and the interactive extract filter
Left-click (green ) for foreground, right-click (red) for background https://i.imgur.com/yG5Ar41.jpg
Separates like this https://i.imgur.com/rbqWDt1.jpg (changed my checker pattern to differ from your screenshot)
I installed the plugin but it does not show in GIMP after I do "Script Fu" > "Refresh"
What I found strange is the path to where GMIC is installed. Here's the path installation mentions:
[
attachment=1072]
(12-09-2017, 08:59 AM)TechnicGeek Wrote: [ -> ]I installed the plugin but it does not show in GIMP after I do "Script Fu" > "Refresh"
First of all, it is not a 'script-fu' it is a plug-in
Quote:What I found strange is the path to where GMIC is installed. Here's the path installation mentions:
It is a big compiled plugin consisting of many files which installs to its own folder. What you showed is the default location. Use it.
You need to add that location to the Gimp plug-ins locations (paths) using the Gimp menu Edit -> Preferences -> Folders -> Plug-ins
Some more information and screenshots
https://www.gimp-forum.net/Thread-G-mic-...99#pid2899
The path looks correct.
Have you tried re-starting Gimp ?
EDIT: ninja'd by rich