简体   繁体   English

如何在 GIMP 中找到选择集群?

[英]How can I find selection clusters in GIMP?

I am using Gimp 2.8.18.我正在使用 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)您将选择转换为路径(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增加 1 个像素
    • 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. ofn-extract-objects Python 脚本做了类似的事情,应该让你开始。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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