What is image mapping :
In image mapping an image is specified with certain set of coordinates inside the image which act as hyperlink areas to different destinations. It is different from an image link since in image linking, an image can be used to serve a single link or destination whereas in a mapped image, different coordinates of the image can serve different links or destinations.
Elements required in Mapping an Image :
There are three basic html elements which are required for creating a mapped image.
- Map : It is used to create a map of the image with clickable areas.
- Image : It is used for the image source on which mapping is done.
- Area : It is used within the map for defining clickable areas.
Steps to create a mapped image :
- Determining Image size :
Determining the size of the image is very important because if the size of the image is changed then the area coordinates will also require updation.
- Creating a map for overlaying the image :
- Determine the coordinates of the areas that you want to map :
It can be done in three shapes which are rectangle, circle and polygon. Coordinates can be found easily by using MS-Paint.
Put all the above steps together as done in the code below.
- Mapping external values to dataframe values in Pandas
- Convert an image into grayscale image using HTML/CSS
- How to specify an image as a server-side image-map in HTML ?
- Getting started with Scikit-image: image processing in Python
- How to hide “Image not found” icon when source image is not found?
- HTML | Responsive full page image using CSS
- How to resize an image in an HTML 5 canvas ?
- How to convert an HTML element or document into image ?
- HTML | DOM Image Object
- HTML | DOM Input Image Object
- Convert an image into Blur using HTML/CSS
- HTML | DOM image naturalWidth property
- HTML | DOM image naturalHeight property
- How to save an HTML 5 Canvas as an image on the server ?
- HTML | DOM Input Image src Property
- HTML | DOM Input Image width Property
- HTML | DOM Input Image type Property
- HTML | DOM Input Image name Property
- HTML | DOM Input Image formTarget Property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.