It is currently Wed Sep 02, 2026 8:13 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 15 posts ] 
Author Message
 Post subject: Selection transfer to Image Map polygon (solved - script)
PostPosted: Wed Nov 27, 2013 8:21 am  (#1) 
Offline
GimpChat Member

Joined: Nov 27, 2013
Posts: 5
I have been searching for a while for a solution to this, to no avail. Perhaps somebody out there in GIMPland can help - as a newbie, I would be eternally grateful. The problem is that if one has defined a selected area in an image, using either selection by color or contiguous selection using the 'magic wand' facility, is possible to copy this selection to the Image Map facility of the image, so as to automatically define a set of coordinates as a polygon that can be used for link purposes? Perhaps there is some interim step that is required, or perhaps a special script is required? Would really appreciate some help on this one - many thanks.


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Area image selection transfer to Image Map polygon
PostPosted: Wed Nov 27, 2013 8:37 am  (#2) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16169
mbs wrote:
I have been searching for a while for a solution to this, to no avail. Perhaps somebody out there in GIMPland can help - as a newbie, I would be eternally grateful. The problem is that if one has defined a selected area in an image, using either selection by color or contiguous selection using the 'magic wand' facility, is possible to copy this selection to the Image Map facility of the image, so as to automatically define a set of coordinates as a polygon that can be used for link purposes? Perhaps there is some interim step that is required, or perhaps a special script is required? Would really appreciate some help on this one - many thanks.

Hi mbs. Welcome to the forum.
In GIMP there is no way to create a linkable area using the color select tools. However you can use Filters>Web>Image Map and use straight edged polygons, rectangles or circles to create linkable areas. It would be nice to see Gimp adopt a new Image map tool that could use the color select tools such as the wand and free select. :)

_________________
Image


Top
 Post subject: Re: Area image selection transfer to Image Map polygon
PostPosted: Wed Nov 27, 2013 9:15 am  (#3) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
You can transform your selection into a path ("Select/To path") and use a script to export the Path (for instance my "path-csv" script) and then do a little bit of editing. This could be usable for fuzzy selections, but color selection that can select random pixels in the image may generate plenty of unusable paths.

_________________
Image


Top
 Post subject: Re: Area image selection transfer to Image Map polygon
PostPosted: Mon Dec 02, 2013 6:28 am  (#4) 
Offline
GimpChat Member

Joined: Nov 27, 2013
Posts: 5
Hi Rod and ofnuts - thank you for your advices, appreciated. You've confirmed what I suspected and that many webmasters in all likelihood see this as a major failing of GIMP (as well as many other products, too). Nonetheless, GIMP remains a good example of what may be achieved through Open Source - have a good day!


Top
 Post subject: Re: Area image selection transfer to Image Map polygon
PostPosted: Mon Dec 02, 2013 8:10 am  (#5) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
mbs wrote:
Hi Rod and ofnuts - thank you for your advices, appreciated. You've confirmed what I suspected and that many webmasters in all likelihood see this as a major failing of GIMP (as well as many other products, too). Nonetheless, GIMP remains a good example of what may be achieved through Open Source - have a good day!


So, the fact that you can do it is a major failing? Interesting...

_________________
Image


Top
 Post subject: Re: Area image selection transfer to Image Map polygon
PostPosted: Mon Dec 02, 2013 9:05 am  (#6) 
Offline
GimpChat Member

Joined: Nov 27, 2013
Posts: 5
Actually, no. My original posting enquired about the possibility of copying a selected area defined by colour selection tools into the Image Map facility. Sure, you've indicated that this should be possible using path transformation/CSV text editing, but that is probably as bad as painstakingly defining a polygon area point-by-point, which is what I'm trying to avoid. This is particularly relevant for GIS-type area location mapping, for example, where every little kink in a meandering stream is relevant, or where prevailing wind direction is affected by topographical features. For your edification, I'm not alone in this <snp>


Top
 Post subject: Re: Area image selection transfer to Image Map polygon
PostPosted: Mon Dec 02, 2013 10:38 am  (#7) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
You misread my post then... and if you are asking on StackOverflow, then you may not be above some scripting, in which case the whole thing can get pretty simple: the script can generate the image map code directly, and can even filter out selection areas that are too small (stray selected pixels). I was only indicating how you could use existing tools I know about (there may be others).

The easiness with which you can write such as script if needed is also a major benefit of open source (both because the Gimp authors aren't hiding anything from anybody, and because you can take my path-csv script and adapt it to your purposes).

_________________
Image


Top
 Post subject: Re: Area image selection transfer to Image Map polygon
PostPosted: Mon Dec 02, 2013 11:26 am  (#8) 
Offline
GimpChat Member

Joined: Nov 27, 2013
Posts: 5
@ofnuts - OK, point taken. Although I'm by no means a scripting expert, I'll certainly give it a bash ('scuse the unintended pun) when time permits...


Top
 Post subject: Re: Area image selection transfer to Image Map polygon
PostPosted: Mon Dec 02, 2013 11:33 am  (#9) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
mbs wrote:
@ofnuts - OK, point taken. Although I'm by no means a scripting expert, I'll certainly give it a bash ('scuse the unintended pun) when time permits...


If you're interested I can give it a whirl. PM me what you need exactly (explanations, URL to sample images, etc...). Some boring project meetings and rainy weekends ahead, so some time to look into it.

_________________
Image


Top
 Post subject: Re: Area image selection transfer to Image Map polygon
PostPosted: Mon Dec 02, 2013 12:24 pm  (#10) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
:ninja :ninja :ninja


Filters->Web->Save Path(s) as HTML poly map...
http://chiselapp.com/user/saulgoode/rep ... th-as-poly

  • Make your selection
  • Convert it to a path ("Select->To Path")
  • Use the script to save your path(s) to a .map file
  • Open the Image Map plug-in
  • Open the .map file

Attachment:
SSzambia.png
SSzambia.png [ 32.35 KiB | Viewed 7332 times ]

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Last edited by saulgoode on Mon Dec 02, 2013 10:23 pm, edited 1 time in total.

Top
 Post subject: Re: Area image selection transfer to Image Map polygon
PostPosted: Mon Dec 02, 2013 12:49 pm  (#11) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16169
saulgoode wrote:
:ninja :ninja :ninja


Filters->Web->Save Path(s) as HTML poly map...
http://chiselapp.com/user/saulgoode/rep ... 481446c96b

  • Make your selection
  • Convert it to a path ("Select->To Path")
  • Use the script to save your path(s) to a .map file
  • Open the Image Map plug-in
  • Open the .map file

Poor Saulgoode ninjad thrice trying to post this fabulous new script. Nicely done Saulgoode! That was very quick by the way. :) :bigthup

Ahh the beauty of opensource. :)

_________________
Image


Top
 Post subject: Re: Selection transfer to Image Map polygon (solved - script)
PostPosted: Mon Dec 02, 2013 1:25 pm  (#12) 
Offline
GimpChat Member

Joined: Nov 27, 2013
Posts: 5
@Rod - indeed! :)
@saulgoode - many thanx to you - will apply to the problem in due course and will post to the forum if any issues arise.


Top
 Post subject: Re: Area image selection transfer to Image Map polygon
PostPosted: Mon Dec 02, 2013 1:43 pm  (#13) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
saulgoode wrote:
:ninja :ninja :ninja


Filters->Web->Save Path(s) as HTML poly map...
http://chiselapp.com/user/saulgoode/rep ... 481446c96b

  • Make your selection
  • Convert it to a path ("Select->To Path")


Maybe you can add a call to plug-in-sel2path?

_________________
Image


Top
 Post subject: Re: Area image selection transfer to Image Map polygon
PostPosted: Mon Dec 02, 2013 9:02 pm  (#14) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
ofnuts wrote:
Maybe you can add a call to plug-in-sel2path?

http://chiselapp.com/user/saulgoode/rep ... th-as-poly

I've also added options to only use either visible or linked paths.
Attachment:
SSmap.png
SSmap.png [ 13.58 KiB | Viewed 2695 times ]

The command is also added to the Paths context menu available by right-clicking on a path in the Paths Dialog.

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Last edited by saulgoode on Mon Dec 02, 2013 9:57 pm, edited 1 time in total.

Top
 Post subject: Re: Area image selection transfer to Image Map polygon
PostPosted: Mon Dec 02, 2013 9:12 pm  (#15) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16169
saulgoode wrote:
ofnuts wrote:
Maybe you can add a call to plug-in-sel2path?

http://chiselapp.com/user/saulgoode/rep ... 17f7259406

I've also added options to only use either visible or linked paths.

Attachment:
SSmap-dialog.png


The command is also added to the Paths context menu available by right-clicking on a path in the Paths Dialog.

Sweet! :)

_________________
Image


Top
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group