Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get all pixel coordinates of selection
#9
(09-29-2021, 02:43 PM)joho21 Wrote:
(09-29-2021, 06:24 AM)PixLab Wrote:
(09-28-2021, 10:28 PM)Ofnuts Wrote: To do this you create a mask of each province before the game starts. To change the color of a province, you use the mask to make a selection, and then bucket fill the selection. 

Another method is to have each province in a separate alpha-locked layer, and then you just bucket-fill the layer with the new color. This technique is also quite easy to implement outside of Gimp with ImageMagick compose for instance. You can even have images of the the provinces in al the colors, and build the map by selecting the province images  with the appropriate colors.

As usual Ofnuts gives good advices
I was thinking to have each province selection already saved in a channel, then the needed channel to selection > bucket-fill of that province selection (or just change the hue)
In the end I prefer by far the the different Ofnuts's solutions, and a preference for the one which can be implemented in ImageMagicK, just to not depend about 1 software in case of a future bug in GIMP Big Grin

Is there a way to do either suggestion within Python itself (the language I'm using)? I've looked at Gimp-Python, but it seems to only be for plugin stuff while I want to actually do it independently within the code. Most of the other suggestions I've looked at are also plugin-related stuff, especially with Python. There doesn't seem to be much in the way of editing the image without any user input.

AFAIK ImageMagick has Python bindings so you can easily do all the image composition from Python. Otherwise Python has image handling libraries such a Pillow.
Reply


Messages In This Thread
RE: Get all pixel coordinates of selection - by Ofnuts - 09-29-2021, 08:53 PM

Forum Jump: