The Cell Game Image Map Editing Tutorial
โœ‚๐Ÿƒ๐Ÿพโ€โ™€๏ธ๐Ÿƒ๐Ÿผโ€โ™‚๏ธ
๐Ÿ“–

The Cell Game Image Map Editing Tutorial

The Cell Game Image Map Editing Tutorial

Yesterdayโ€™s CSS3 Filters Image Editing Tutorialโ€˜s saw us introduce an โ€œin place image editingโ€ external Javascript img_svgโšซjs tool.

Today sees us get a โ€œsecond cab off the rankโ€ going using that tool with the web application of The Cell Game Primer Tutorial, and its interest lies in its modus operandi, principally an โ€œimage mapโ€, which is basically an HTML img whose onclick logic is often โ€œtaken overโ€ by a โ€œmapโ€ full of โ€œareaโ€ subelements partitioning off an area of the image associated with that areaโ€™s โ€œhrefโ€ attributed destination or โ€œonclickโ€ action. We discovered a useful thing here, when we changed an image map definition end part as per โ€ฆ



<!--area shape="default" nohref alt="" /-->

</map>

Yes, make this change and the โ€œnon catered forโ€ area parts are allowed through to the keeper, that being the underlying HTML img element, which we can write โ€œonclickโ€ logic for to involve our image editing tool ideas.

Feel free to try themildly changed the_cellโšซhtmlโ€˜s The Cell Game.


Previous relevant CSS3 Filters Primer Tutorial is shown below.

CSS3 Filters Primer Tutorial

CSS3 Filters Primer Tutorial

Itโ€™s not just the image editor Gimp that has โ€œfiltersโ€ as tools to create effects with image data (files), as you might see with tutorials like Gimp Decor Filters Revisit Tutorial. These days, with CSS, and with CSS3 these days, there are some great โ€œfiltersโ€ to play around with, that modify an image there and then with CSS and/or Javascript DOM (as per the HTML select โ€œdropdownโ€ element onchange event logic โ€ฆ



function selchange(selo) {

var bs="";

if (selo == null) {

if (document.getElementById("sh-shadow").value != "" && document.getElementById("sv-shadow").value != "") {

if (document.getElementById("xblur").value != "") bs+=document.getElementById("xblur").value + document.getElementById("xblur").title + " ";

if (document.getElementById("sspread").value != "") bs+=document.getElementById("sspread").value + document.getElementById("sspread").title + " ";

//alert("drop-shadow(" + document.getElementById("sh-shadow").value + document.getElementById("sh-shadow").title + " " + document.getElementById("sv-shadow").value + document.getElementById("sv-shadow").title + " " + bs + document.getElementById("mycolour").value + ")");

document.getElementById("myimage").style.filter = "drop-shadow(" + document.getElementById("sh-shadow").value + document.getElementById("sh-shadow").title + " " + document.getElementById("sv-shadow").value + document.getElementById("sv-shadow").title + " " + bs + document.getElementById("mycolour").value + ")";

document.getElementById("myimage").style.WebkitFilter = "drop-shadow(" + document.getElementById("sh-shadow").value + document.getElementById("sh-shadow").title + " " + document.getElementById("sv-shadow").value + document.getElementById("sv-shadow").title + " " + bs + document.getElementById("mycolour").value + ")";

}

} else if (selo.id.substring(1) == 'h-shadow') {

if (document.getElementById("sv-shadow").value != "") {

if (document.getElementById("xblur").value != "") bs+=document.getElementById("xblur").value + document.getElementById("xblur").title + " ";

if (document.getElementById("sspread").value != "") bs+=document.getElementById("sspread").value + document.getElementById("sspread").title + " ";

document.getElementById("myimage").style.filter = "drop-shadow(" + selo.value + selo.title + " " + document.getElementById("sv-shadow").value + document.getElementById("sv-shadow").title + " " + bs + document.getElementById("mycolour").value + ")";

document.getElementById("myimage").style.WebkitFilter = "drop-shadow(" + selo.value + selo.title + " " + document.getElementById("sv-shadow").value + document.getElementById("sv-shadow").title + " " + bs + document.getElementById("mycolour").value + ")";

}

} else if (selo.id.substring(1) == 'v-shadow') {

if (document.getElementById("sh-shadow").value != "") {

if (document.getElementById("xblur").value != "") bs+=document.getElementById("xblur").value + document.getElementById("xblur").title + " ";

if (document.getElementById("sspread").value != "") bs+=document.getElementById("sspread").value + document.getElementById("sspread").title + " ";

//alert("drop-shadow(" + document.getElementById("sh-shadow").value + document.getElementById("sh-shadow").title + " " + selo.value + selo.title + " " + bs + document.getElementById("mycolour").value + ")");

document.getElementById("myimage").style.filter = "drop-shadow(" + document.getElementById("sh-shadow").value + document.getElementById("sh-shadow").title + " " + selo.value + selo.title + " " + bs + document.getElementById("mycolour").value + ")";

document.getElementById("myimage").style.WebkitFilter = "drop-shadow(" + document.getElementById("sh-shadow").value + document.getElementById("sh-shadow").title + " " + selo.value + selo.title + " " + bs + document.getElementById("mycolour").value + ")";

}

} else if (selo.id == 'xblur') {

if (document.getElementById("sh-shadow").value != "" && document.getElementById("sv-shadow").value != "") {

if (document.getElementById("xblur").value != "") bs+=document.getElementById("xblur").value + document.getElementById("xblur").title + " ";

if (document.getElementById("sspread").value != "") bs+=document.getElementById("sspread").value + document.getElementById("sspread").title + " ";

document.getElementById("myimage").style.filter = "drop-shadow(" + document.getElementById("sh-shadow").value + document.getElementById("sh-shadow").title + " " + document.getElementById("sv-shadow").value + document.getElementById("sv-shadow").title + " " + bs + document.getElementById("mycolour").value + ")";

document.getElementById("myimage").style.WebkitFilter = "drop-shadow(" + document.getElementById("sh-shadow").value + document.getElementById("sh-shadow").title + " " + document.getElementById("sv-shadow").value + document.getElementById("sv-shadow").title + " " + bs + document.getElementById("mycolour").value + ")";

}

} else if (selo.id.substring(1) == 'spread') {

if (document.getElementById("sh-shadow").value != "" && document.getElementById("sv-shadow").value != "") {

if (document.getElementById("xblur").value != "") bs+=document.getElementById("xblur").value + document.getElementById("xblur").title + " ";

if (document.getElementById("sspread").value != "") bs+=document.getElementById("sspread").value + document.getElementById("sspread").title + " ";

document.getElementById("myimage").style.filter = "drop-shadow(" + document.getElementById("sh-shadow").value + document.getElementById("sh-shadow").title + " " + document.getElementById("sv-shadow").value + document.getElementById("sv-shadow").title + " " + bs + document.getElementById("mycolour").value + ")";

document.getElementById("myimage").style.WebkitFilter = "drop-shadow(" + document.getElementById("sh-shadow").value + document.getElementById("sh-shadow").title + " " + document.getElementById("sv-shadow").value + document.getElementById("sv-shadow").title + " " + bs + document.getElementById("mycolour").value + ")";

}

} else {

document.getElementById("myimage").style.filter = selo.id.substring(1) + "(" + selo.value + selo.title + ")";

document.getElementById("myimage").style.WebkitFilter = selo.id.substring(1) + "(" + selo.value + selo.title + ")";

}

}

) โ€ฆ or jQuery means by which to make this happen with a lot of the modern web browsers. If you see โ€œCSS3โ€ mentioned, then donโ€™t expect everything to work on super-old web browsers, but expect that anything you implement could be aesthetically interesting or pleasing, as it would not have taken until CSS3 to come along if it was a dead set simple thing to have implemented in the early days of the internet.

Todayโ€™s simple (really) proof of concept web application owes a debt of gratitude to this very useful link, which gave us the parameters by which we could construct todayโ€™s liveโœ‚run with its pretty simple HTML and CSS (via CSS3) and Javascript DOM css_filtersโšซhtml source code for you to peruse, and make of what you will. So what (CSS3) filters are we talking about here?

  • blur(px)
  • brightness(%)
  • contrast(%)
  • drop-shadow(h-shadow v-shadow blur spread color)
  • grayscale(%)
  • hue-rotate(deg)
  • invert(%)
  • opacity(%)
  • saturate(%)
  • sepia(%)

โ€ฆ which are mostly self explanatory we hope. Letโ€™s just say youโ€™re me โ€ฆ โ€œYouโ€™re me.โ€ โ€ฆ ta โ€ฆ please explain โ€œdrop shadowโ€ โ€ฆ oh โ€ฆ you mean โ€ฆ me?

In graphic design, a drop shadow is a visual effect consisting of a drawing element which looks like the shadow of an object, giving the impression that the object is raised above the objects behind it.

โ€ฆ thanks, Wikipedia.

As you can imagine, this opening up of this functionality to the client-side web developer opens up lots of opportunities to make your webpages stand out.


Previous relevant Gimp Decor Filters Revisit Tutorial is shown below.

Gimp Decor Filters Revisit Tutorial

Gimp Decor Filters Revisit Tutorial

Today we return to the wonderful, marvellous and stupendous Gimp image editor and examine some more of its filters, following up on concepts last discussed with Gimp Decor Border Filters Primer Tutorial in the โ€œDecorโ€ category, namely โ€ฆ

  • Fuzzy Border
  • Coffee Stain
  • Old Photo โ€ฆ in the tutorial picture โ€ฆ plus below โ€ฆ
  • Add Bevel
  • Add Border
  • Slide
  • Rounded Corners

โ€ฆ which create quite good effects we feel, especially the Fuzzy Border filter, as it is quite difficult, otherwise to create a โ€œsmudgedโ€ border effect, perhaps for vignetting purposes, without this filter. We imagine an old map photo could be glamourized using โ€œCoffee Stainโ€ (for the accident prone) or โ€œOld Photoโ€.

These โ€œDecorโ€ filters are available off Gimpโ€™s Filter menu as a submenu containing these and some other effects. They use โ€œScript-Fuโ€ based on the Scheme interpretive language. These โ€œScript-Fuโ€ filters are not only powerful and useful for what they are, but also for how you can introduce predictability with your effects, in that you can record settings you use, make them public, as necessary, to help create a unified creative but predictable set of effects in the photographs you are applying filters to.

So weโ€™ll leave you with a photo of our house โ€ฆ

Our house, in the middle of our street

โ€ฆ with โ€ฆ

  • Fuzzy Border โ€ฆ
    Our house, in Fuzzy Border
  • Coffee Stain (โ€œDarken onlyโ€ unchecked) โ€ฆ probably not so apt for this imageโ€™s subject matter โ€ฆ
    Our house, in Coffee Stain
  • Old Photo (โ€œDefocusโ€, โ€œSepiaโ€, โ€œMottleโ€ all checked) โ€ฆ
    Our house, in Old Photo
  • Add Bevel (30, โ€œKeep bump layerโ€ checked) โ€ฆ
    Our house, in Add Bevel
  • Add Border (37 x and 37 y width, 85 delta value on default blue colour) โ€ฆ
    Our house, in Add Border
  • Slide (62) โ€ฆ
    Our house, in Slide
  • Rounded Corners (Edge radius 30, Shadow x offset 15, y 15, Blur radius 25) โ€ฆ
    Our house, in Rounded Corners

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

This entry was posted in eLearning, Event-Driven Programming, Tutorials and tagged , , , , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *