简体   繁体   中英

How can I find selection clusters in GIMP?

I am using Gimp 2.8.18. I have an image containing a very large map with tiny street names. When printed on paper the street names become unreadable because they are too small. I would like to enhance the image by enlarging the street names.

Selecting a street name by color and scaling that selection seems to work quite well. The precondition is that only one street name is selected. Otherwise, if all street names are selected and scaled, the positions are modified such that the street names do not belong to the street anymore.

How can I select only one street name at a time? Because the image is really, really large, this needs to be automized. But how can I automize that? Selection by color selects all pixels in the large image. This very large selection contains many "clusters", each of them being one street name.

Please check this example - there are two selection clusters because there are two street names:

不幸的是,所有街道名称都被选中,有 t

If I could automatically restrict the selection to one cluster, I could do a loop over the clusters and scale each of them. How can I do that?

To see the possible result, please check the next picture. It shows how a scaled street name looks like. This is not really pretty, but still improves the printed map a lot:

缩放较低街道名称的结果

Once you have the selection,

  • You transform the selection to a path (plugin-sel2path)
  • This path will have a "stroke" per selection cluster
  • For each of these strokes:
    • Create a path from it
    • Make a selection from that new path
    • Grow it by 1 pixel
    • Intersect it with the initial selection, and you should have exactly one of the clusters.

Theofn-extract-objects Python script does something similar, and should get you started.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM