Color selection tool - Printable Version +- Gimp-Forum.net (https://www.gimp-forum.net) +-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP) +--- Forum: General questions (https://www.gimp-forum.net/Forum-General-questions) +--- Thread: Color selection tool (/Thread-Color-selection-tool) |
Color selection tool - evigor - 11-04-2021 Dear all, I'm vectorizing images with the help of GIMP. I start with an image like this: then with the color selection tool I select all the lines: ad after I export the selection to Qgis, with an apposite tool. The problem is that the selection for each line is "doubled": one for one side, one for the other. Here a zoom: Well...is there the possibility for GIMP (maybe with a different tool) to select with just a "line selection", right in the center of the original lines? Thank you RE: Color selection tool - rich2005 - 11-04-2021 Gimp is a raster (bitmap) graphics tool. Works with (usually) square pixels. The semi-transparent ones you see are 'anti-aliasing' pixels added to give the impression of smoothness. If you want a solid line of single pixels then dis-able the Colour Select Tool anti-aliasing and increase the threshold value to 50- 70 something like this. Then fill the selection on a new layer. [attachment=7001] However Gimp is not the tool for vector work. Inkscape is and your original png converted to a SVG looks like this. [attachment=7002] Edit: If a black / white image is ok for Qgis then you can use The threshold tool Colors -> Threshold [attachment=7003] RE: Color selection tool - evigor - 11-04-2021 Thank you rich2005, things are a little more complicated: the raster image in geotagged and have others data inside. I suppose Inkscape cannot convert mantaining georeference and data. Another problem is importing svg to Qgis. So...gimp seems the answer, problem is just those double lines. Thank you for the efforts! RE: Color selection tool - rich2005 - 11-04-2021 There is always a way, although not too sure that Gimp will retain the geodata Try 1. Layer -> Duplicte the layer 2. Colour pick that yellowish color 3. Color select the white background 4. Select -> Grow 1 pixel 5. Fill the selection with White (drag in from the BG swatch) 6 Select -> Invert (the selection) 7 Fill with the FG 'yellowish' colour (drag in from the FG swatch) 8. Select -> None to turn the selection off 9. Turn the visibility of the top layer off and make the bottomlayer active 10. Colors -> Threshold to give a BW layer 11. Back to the top layer and make it visible 12 Set the top layer mode to 'Darken Only' 13. Layer -> Merge Down to merge the layers. Lots of steps but I can get in 1 minute demo https://i.imgur.com/A2N8D5e.mp4 There will be other ways. RE: Color selection tool - evigor - 11-08-2021 Dear rich2005, thank you for the efforts, but I can export the "select by colour" selection to Qgis via gimp plugin. I export ONLY the selection, that's a vector object. The problem is to select just a line and not two lines: One line in the original raster image gives two "select by colour" dotted lines. Those dotted lines are the vector export to Qgis software. So my problem is to have just one dotted line per original raster line. Maybe "select by colour" tool is not the best tool...but my GIMP knowledge is very trivial Thank you for all the efforts! P.s.: here the selection in qgis: RE: Color selection tool - rich2005 - 11-08-2021 I think you have the wrong idea about selections. Quote:I'm vectorizing images with the help of GIMP. I start with an image like this:....snip.... And you select the black borders. Because the lines have anti-aliasing to 'smooth' them the selection includes the light coloured pixels - Remember what I wrote, Gimp is a raster editor, the image is made up of rectangular pixels. You can not split a pixel with a selection, you get the border. Quote:...Those dotted lines are the vector export to Qgis software.. They are not a vector they are a selection. You can remove the light coloured pixels as previous post but the selection will still be the outline. Quote:..snip..Well...is there the possibility for GIMP (maybe with a different tool) to select with just a "line selection", right in the center of the original lines? Right in the center means a path and that it is a vector. It has zero width in Gimp. A path can be stroked to give a line, then it is back to either single pixels or an antialised line depending on how the stoke is applied. If you select the path then it is back to an outline selection. Gimp can save the paths in a Gimp .xcf file. This example attached with active selection and path so you can see the difference. [attachment=7033] Edit: Is it this plugin https://plugins.qgis.org/plugins/gimpselectionfeature_plugin/version/1.6/ ? A vector (path) might not give the best result. The path provided a selection Select -> From Path but that includes any pixel the path crosses. You might be better off with just the single pixel lines as discussed previously. [attachment=7032] RE: Color selection tool - evigor - 11-08-2021 (11-08-2021, 11:14 AM)rich2005 Wrote: Edit: Is it this plugin https://plugins.qgis.org/plugins/gimpselectionfeature_plugin/version/1.6/ ? Yes it is. In qgis I have a georeferenced vector. It seems there is not a fast solution at the problem Thank you for the help! |