One Image Your Own Slideshow Dynamic CSS Filters and Transforms Tutorial
โœ‚๐Ÿƒ๐Ÿพโ€โ™€๏ธ๐Ÿƒ๐Ÿผโ€โ™‚๏ธ
๐Ÿ“–

One Image Your Own Slideshow Dynamic CSS Filters and Transforms Tutorial

One Image Your Own Slideshow Dynamic CSS Filters and Transforms Tutorial

Up to the One Image Your Own Site Dynamic CSS Filters and Transforms Tutorial of yesterday, weโ€™ve talked about random image orderings and arrangements. But if we are offering the functionality of a user defined numeric image sequence, it could be possible that those images are in order for a reason. One reason we can think of for todayโ€™s consideration, is that the images are designed for a โ€ฆ

  • slideshow โ€ฆ which weโ€™ll animate via the image being a background image to an HTML div element โ€ฆ but because this does not have the web browser (Windows) right click nor (Mac OS X) two finger gesture option โ€œSave Image Asโ€ nor โ€œCopy Imageโ€ (which are pretty obviously very useful), we add into the mix โ€ฆ
  • canvas slideshow โ€ฆ which we animate via the image being the first argument to the [canvasContext].drawImage(imageObject,left,top) call

โ€ฆ for those users appreciating the inherent orderliness (and sense) of their nominated sequence of images (URL).

How do we place this slideshow display into the position that was previously the โ€œrandomised image display areaโ€? Itโ€™s an โ€œoverlayโ€ job only in the sense that z-index is used, but today, more the go is โ€ฆ

  • to attribute the โ€œrandomised imageโ€ display:none โ€ฆ and then from with the child iframe โ€œEphemeralโ€ frame of reference use โ€ฆ


    rect=parent.document.getElementById('myiframe').getBoundingClientRect();


    โ€ฆ to get position of where the โ€œEphemeralโ€ child HTML iframe is positioned that will be slid on top off via a negative margin-top as per โ€ฆ


  • parent.document.getElementById('diviframe').style.zIndex='9';

    parent.document.getElementById('diviframe').style.width=Math.floor(eval('' + rect.right) - eval('' + rect.left)) + 'px';

    parent.document.getElementById('diviframe').style.marginTop=Math.floor(eval('' + rect.top) - eval('' + rect.bottom)) + 'px';

    parent.document.getElementById('diviframe').style.height=Math.floor(eval('' + rect.bottom) - eval('' + rect.top)) + 'px';

    parent.document.getElementById('diviframe').innerHTML='<canvas class=iframe id=' + hsuffix.substring(1) + ' height=' + Math.floor(eval('' + rect.bottom) - eval('' + rect.top)) + 'px width=' + Math.floor(eval('' + rect.right) - eval('' + rect.left)) + 'px></canvas>';


    โ€ฆ which all works because back at the parent โ€ฆ
  • a new HTML div element is added at its bottom โ€ฆ


    <div class=iframe id=diviframe></div>


    โ€ฆ and โ€ฆ
  • a couple of new Emoji โ€œbuttonsโ€ โ€ฆ


    &nbsp;<a style="text-decoration:none;cursor:pointer;" title="Slideshow" onclick="if (document.getElementById('iurl').value.toLowerCase('//') != -1) { document.getElementById('ayours').href='//www.rjmprogramming.com.au/ephemeral/index.htm?first=' + encodeURIComponent(document.getElementById('iurl').value.split('#')[0] + '#diviframe'); document.getElementById('ayours').click(); } ">&#127902;</a>&nbsp;<a style="text-decoration:none;cursor:pointer;" title="Canvas slideshow" onclick="if (document.getElementById('iurl').value.toLowerCase('//') != -1) { document.getElementById('ayours').href='//www.rjmprogramming.com.au/ephemeral/index.htm?first=' + encodeURIComponent(document.getElementById('iurl').value.split('#')[0] + '#canvasiframe'); document.getElementById('ayours').click(); } ">&#127912;</a>&nbsp;


    โ€ฆ are the means by which a user can specify a slideshow display mode of use

So now the PHP liveโœ‚run code looks like one_imageโšซphp and changedin this way for slideshow functionality.



Previous relevant One Image Your Own Site Dynamic CSS Filters and Transforms Tutorial is shown below.

One Image Your Own Site Dynamic CSS Filters and Transforms Tutorial

One Image Your Own Site Dynamic CSS Filters and Transforms Tutorial

Onto yesterdayโ€™s One Image Site Dynamic CSS Filters and Transforms Tutorial filtering and transform start to proceedings, today we โ€ฆ

  • genericize the data source
  • create a kaleidoscopic slideshow feel for user defined image data sets

โ€ฆ by allowing, in a client Javascript way (ie. sticking with HTML/Javascript/CSS), to โ€œwiden the netโ€ of what images we show by asking the user for their own โ€œstart image of a numerical sequenceโ€ URL.

Being as Javascript canโ€™t do anything like PHPโ€™s glob, how can we do this? Well, by enforcing a rule that any image sequence needs to be continuous over an increment of one to its โ€œnumerical partโ€ we can use the Client Pre-Emptive Iframe methods, that you may recall in earlier episodes is a lot like โ€œsuck it and seeโ€, to not need any serverside intervention, like PHP, to help us out here. In broad brush terms, weโ€™ve allowed the Ephemeral โ€œOne Image Websiteโ€ cater for these genericizations so that โ€ฆ

  • where it used to hardcode a list of image files, we surround that bit with โ€ฆ


    var i_list = new Array();

    var isokay=true, cutshort=false, filis='', firstfilis='', precccp='', postcccp='', divbit='';

    var bbb='', lastok='';

    var ifirstis=location.search.split('first=')[1] ? decodeURIComponent(location.search.split('first=')[1].split('&')[0]) : '';

    var cccp=location.search.split('cccp=')[1] ? decodeURIComponent(location.search.split('cccp=')[1].split('&')[0]) : '';

    var cccs=location.search.split('cccs=')[1] ? decodeURIComponent(location.search.split('cccs=')[1].split('&')[0]) : '';

    var isnum=location.search.split('isnum=')[1] ? eval(location.search.split('isnum=')[1].split('&')[0]) : 1;

    var inextis=location.search.split('next=')[1] ? decodeURIComponent(location.search.split('next=')[1].split('&')[0]) : '';



    if (ifirstis != '') {

    if (ifirstis.indexOf('*') != -1) {

    cccp=ifirstis.split('*')[0];

    cccs=ifirstis.split('*')[1];

    filis=' '; //cccp + isnum + cccs;

    ifirstis=cccp + isnum + cccs;

    } else if (ifirstis.indexOf('%') != -1) {

    cccp=ifirstis.split('%')[0];

    cccs=ifirstis.split('%')[1];

    filis=' '; //cccp + isnum + cccs;

    ifirstis=cccp + isnum + cccs;

    } else if (ifirstis.indexOf('?') != -1) {

    cccp=ifirstis.split('?')[0];

    cccs=ifirstis.split('?')[1];

    filis=' '; //cccp + isnum + cccs;

    ifirstis=cccp + isnum + cccs;

    } else {

    if (ifirstis.indexOf('/') != -1) {

    precccp=ifirstis.replace(('/' + ifirstis.split('/')[eval(-1 + ifirstis.split('/').length)]),'/');

    postcccp=ifirstis.split(precccp)[1];

    cccp=precccp + postcccp.split('1')[0].split('2')[0].split('3')[0].split('4')[0].split('5')[0].split('6')[0].split('7')[0].split('8')[0].split('9')[0];

    } else {

    cccp=ifirstis.split('1')[0].split('2')[0].split('3')[0].split('4')[0].split('5')[0].split('6')[0].split('7')[0].split('8')[0].split('9')[0];

    }

    if (cccp == ifirstis) {

    ifirstis='';

    } else {

    isnum=eval(ifirstis.split(cccp)[1].split('of.')[0].split('of1')[0].split('of2')[0].split('of3')[0].split('of4')[0].split('of5')[0].split('of6')[0].split('of7')[0].split('of8')[0].split('of9')[0].split('.')[0]);

    cccs=ifirstis.split(cccp + isnum)[1];

    ifirstis=cccp + isnum + cccs;

    filis=' '; //cccp + isnum + cccs;

    }

    }

    if (filis != '') {

    if (inextis != '' && inextis != (cccp + isnum + cccs)) {

    var jfirstis=ifirstis;

    while (inextis != '' && inextis != jfirstis) {

    //document.title=inextis;

    i_list[i_index++] = jfirstis;

    lastok=jfirstis;

    if (cccp.indexOf('0') == -1) {

    isnum++;

    jfirstis=cccp + isnum + cccs;

    } else if (('' + isnum).length == ('' + eval(1 + isnum)).length) {

    isnum++;

    jfirstis=cccp + isnum + cccs;

    } else {

    cccp=cccp.substring(0, eval(-1 + cccp.length));

    isnum++;

    jfirstis=cccp + isnum + cccs;

    }

    }

    }

    if (filis == ' ') {

    filis=cccp + isnum + cccs;

    }

    divbit='<iframe id="imi" style="display:none;" onload="tryif(this);" onerror="if ((cccp + isnum + cccs) == filis) { filis=bbb; isokay=false; } else { isokay=false; }" src="' + filis.replace('http:','').replace('https:','') + '"></iframe>';

    }

    }

    if (ifirstis == '') {



    for (jjj=5; jjj<=56; jjj++) {

    anotherFilename(jjj);

    }

    }

  • the โ€œfunction tryif()โ€ being the essence of what we mean by โ€œClient Pre-Emptive Iframeโ€ โ€ฆ


    function tryif(iois) {

    if (iois != null) {

    var aconto = (iois.contentWindow || iois.contentDocument);

    if (aconto != null) {

    if (aconto.document) { aconto = aconto.document; }

    if (aconto.body != null) {

    if (aconto.body.innerHTML.replace(/\<img/g,'').replace(/\<\/img\>/g,'').replace(/\<pre\>/g,'').replace(/\<\/pre\>/g,'').indexOf('<') == -1 && aconto.body.innerHTML.indexOf('>Not Found<') == -1 && aconto.body.innerHTML.indexOf('>   S<') == -1 && aconto.body.innerHTML.indexOf('>&nbsp;&nbsp;&nbsp;S<') == -1) {

    //i_list[i_index++] = iois.src;

    if (cccp.indexOf('0') == -1) {

    isnum++;

    if (1 == 1) {

    isokay=false;

    cutshort=true;

    location.href=document.URL.split('#')[0].split('?')[0] + '?first=' + encodeURIComponent(ifirstis) + '&next=' + encodeURIComponent(cccp + isnum + cccs);

    return;

    } else {

    iois.src=cccp + isnum + cccs;

    }

    } else if (('' + isnum).length == ('' + eval(1 + isnum)).length) {

    isnum++;

    if (1 == 1) {

    isokay=false;

    cutshort=true;

    location.href=document.URL.split('#')[0].split('?')[0] + '?first=' + encodeURIComponent(ifirstis) + '&next=' + encodeURIComponent(cccp + isnum + cccs);

    return;

    } else {

    iois.src=cccp + isnum + cccs;

    }

    } else {

    cccp=cccp.substring(0, eval(-1 + cccp.length));

    isnum++;

    if (1 == 1) {

    isokay=false;

    cutshort=true;

    location.href=document.URL.split('#')[0].split('?')[0] + '?first=' + encodeURIComponent(ifirstis) + '&next=' + encodeURIComponent(cccp + isnum + cccs);

    return;

    } else {

    iois.src=cccp + isnum + cccs;

    }

    }

    } else {

    isokay=false;

    }

    } else {

    isokay=false;

    }

    } else {

    isokay=false;

    }

    } else {

    isokay=false;

    }

    }

  • and at document.body onload event โ€ฆ


    <body id="body" onload='prefade(); window.setTimeout("FadeInImage()", 4000); '>


    โ€ฆ we need to do (new and first and extra) โ€ฆ


    function prefade() {

    if (divbit != '') {

    if (lastok != '') {

    document.getElementById('place').src=lastok;

    document.getElementById('thedivlink').innerHTML=document.getElementById('thedivlink').innerHTML.replace('Ephemeral - ','Loading ' + lastok + ' - ');

    } else {

    document.getElementById('place').src=ifirstis;

    document.getElementById('thedivlink').innerHTML=document.getElementById('thedivlink').innerHTML.replace('Ephemeral - ','Loading ' + ifirstis + ' - ');

    }

    document.getElementById('imdiv').innerHTML=divbit;

    }

    }

  • and that sometimes with these types of arrangements you know something useful (even in client Javascript โ€œlandโ€) ahead of document.body onload event (like getting ? and & arguments, for example, as you saw above) and to implement that โ€œknowledgeโ€ on the fly we sometimes use document.write method as with changed โ€ฆ


    <script type='text/javascript'>

    if (lastok != '') {

    document.write('<img border=0 id="place" title="Click for Soul Stacker Mechanism provided by //www.freesoundtrackmusic.com" alt="Ephemeral - RJM Programming ... you might see this while loading ... click here now to just play music (Soul Stacker Mechanism provided by //www.freesoundtrackmusic.com) with less variety of imagery ... else please wait for full functionality ..." src="' + lastok + '" />');

    } else if (ifirstis != '') {

    document.write('<img border=0 id="place" title="Click for Soul Stacker Mechanism provided by //www.freesoundtrackmusic.com" alt="Ephemeral - RJM Programming ... you might see this while loading ... click here now to just play music (Soul Stacker Mechanism provided by //www.freesoundtrackmusic.com) with less variety of imagery ... else please wait for full functionality ..." src="' + ifirstis + '" />');

    } else {

    document.write('
    <img border=0 id="place" title="Click for Soul Stacker Mechanism provided by //www.freesoundtrackmusic.com" alt="Ephemeral - RJM Programming ... you might see this while loading ... click here now to just play music (Soul Stacker Mechanism provided by //www.freesoundtrackmusic.com) with less variety of imagery ... else please wait for full functionality ..." src="siteimage.jpg" />');

    }

    </script>


โ€ฆ to substitute into the โ€œimage listโ€ a new image list based on the โ€œClient Pre-Emptive Iframeโ€ โ€œsuccess listโ€ from above, ready to join in with the rest of the workflow to the โ€œEphemeralโ€ โ€œOne Image Websiteโ€ code logic, that displays that image list in a random fashion to do with image names and scrolling positions, over time.

The extra work to do with yesterdayโ€™s PHP code just involves collecting that โ€œstart image URLโ€ from the user and ready the call to the โ€œEphemeralโ€ โ€œOne Image Siteโ€ HTML/Javascript/CSS as per โ€ฆ



<br><a id="ayours" target="myiframe" href="//www.rjmprogramming.com.au/ephemeral/index.htm"> Your Own Public Website Image Sequence</a> <input type=url style="width:750px;" value="" onblur="if (this.value.toLowerCase('//') != -1) { document.getElementById('ayours').href='//www.rjmprogramming.com.au/ephemeral/index.htm?first=' + encodeURIComponent(this.value); if (1 == 7) { document.getElementById('ayours').click(); } }" placeholder="First image URL in numerical sequence eg. //www.rjmprogramming.com.au/Mac/Ansible/Jenkins/ansible_jenkins_primer-364of.jpg"></input>

โ€ฆ for when the user clicks/touches the associated new input type=button button.

This PHP liveโœ‚run code now looks like one_imageโšซphp and changedin this way for your perusal.


Previous relevant One Image Site Dynamic CSS Filters and Transforms Tutorial is shown below.

One Image Site Dynamic CSS Filters and Transforms Tutorial

One Image Site Dynamic CSS Filters and Transforms Tutorial

In this blogโ€™s menu, up the top, there is a menu item called โ€œOne Image Siteโ€, where you can (navigate to) see websites displaying (parts of) random single images, of a theme, that dynamically change. They feature โ€ฆ

  • photography
  • photographic effects applied later via image editing desktop application work

โ€ฆ and today, we add to that, via the auspices of the CSS power to inherit, a new PHP web application that โ€ฆ

  • allows you to select a โ€œOne Image Siteโ€ theme of interestโ€ฆ hosted in a โ€ฆ
  • child HTML iframe element โ€ฆ to which the web application โ€ฆ
  • allows you to select a CSS filter and/or transformation effect

โ€ฆ which, when applied, via dynamically applied CSS styling, (in turn) via Javascript DOM, as in (where variable โ€œovโ€ contains CSS filter and/or transform styling) โ€ฆ



document.getElementById('sfilter').innerHTML+='<style> ' + ov.replace(/iframe \{ \}/g,' ') + ' </style> ';

โ€ฆ can add a whole new (โ€œonions of the 4th dimensionโ€) layer of user defined interest to the underlying photography work. Cute, huh? You can read more ideas, on this same theme, in the recent Gimp Guillotine Follow Up Image Transformations Tutorial below.

So far the PHP liveโœ‚run code looks like one_imageโšซphp for your perusal.


Previous relevant Gimp Guillotine Follow Up Image Transformations Tutorial is shown below.

Gimp Guillotine Follow Up Image Transformations Tutorial

Gimp Guillotine Follow Up Image Transformations Tutorial

Following todayโ€™s work along with yesterdayโ€™s Gimp Guillotine Follow Up Image Filters Tutorial we now have two strands of CSS based functionality โ€ฆ

  • yesterdayโ€™s CSS filter property work โ€ฆ and โ€ฆ
  • todayโ€™s CSS transform property work

โ€ฆ the latter there for your more geometrically based concepts as per โ€ฆ

Part of todayโ€™s liveโœ‚runโ€˜s PHP gimp_guillotine_followupโšซphpโ€˜s changedcode is to allow for multiple combinations between and among the โ€œfilterโ€ and โ€œtransformโ€ CSS property functionalities.

How do you cater for multiple โ€œfilterโ€ or โ€œtransformโ€ CSS property functionality syntax? A space character can separate.

โ€ฆ and/or we can involve โ€œfilterโ€ multiple actions as well as โ€œtransformโ€ ones as per โ€ฆ

How do we allow for multiple โ€œfilterโ€ or โ€œtransformโ€ CSS property functionality definition by the user? We set a fairly large setTimeout(fc, 8000) mode of calling it into play. Then during that 8 second delay, should the user click another โ€œfilterโ€ or โ€œtransformโ€ CSS button, this CSS is appended to whatever is already there and a Javascript function tidies this up before the HTML navigation is made, via โ€ฆ



function restyle() {

var ov=document.getElementById('style').value;

var ihuha=0;

var origov=ov;

var huha=ov.split('-webkit-transform:');

if (huha.length > 2) {

for (ihuha=eval(-1 + huha.length); ihuha>=2; ihuha--) {

ov=ov.replace('-webkit-transform:' + huha[1].split(';')[0] + ';', '-webkit-transform:' + huha[ihuha].split(';')[0] + ' ' + huha[1].split(';')[0] + ';');

ov=ov.replace('-webkit-transform:' + huha[ihuha].split(';')[0] + ';', '');

huha=ov.split('-webkit-transform:');

}

}

huha=ov.split(' transform:');

if (huha.length > 2) {

for (ihuha=eval(-1 + huha.length); ihuha>=2; ihuha--) {

ov=ov.replace(' transform:' + huha[1].split(';')[0] + ';', ' transform:' + huha[ihuha].split(';')[0] + ' ' + huha[1].split(';')[0] + ';');

ov=ov.replace(' transform:' + huha[ihuha].split(';')[0] + ';', '');

huha=ov.split(' transform:');

}

}

huha=ov.split('-webkit-filter:');

if (huha.length > 2) {

for (ihuha=eval(-1 + huha.length); ihuha>=2; ihuha--) {

ov=ov.replace('-webkit-filter:' + huha[1].split(';')[0] + ';', '-webkit-filter:' + huha[ihuha].split(';')[0] + ' ' + huha[1].split(';')[0] + ';');

ov=ov.replace('-webkit-filter:' + huha[ihuha].split(';')[0] + ';', '');

huha=ov.split('-webkit-filter:');

}

}

huha=ov.split(' filter:');

if (huha.length > 2) {

for (ihuha=eval(-1 + huha.length); ihuha>=2; ihuha--) {

ov=ov.replace(' filter:' + huha[1].split(';')[0] + ';', ' filter:' + huha[ihuha].split(';')[0] + ' ' + huha[1].split(';')[0] + ';');

ov=ov.replace(' filter:' + huha[ihuha].split(';')[0] + ';', '');

huha=ov.split(' filter:');

}

}

if (origov != ov) { document.getElementById('style').value=ov.replace(/div\, img \{ \}/g,' '); }

}


Previous relevant Gimp Guillotine Follow Up Image Filters Tutorial is shown below.

Gimp Guillotine Follow Up Image Filters Tutorial

Gimp Guillotine Follow Up Image Filters Tutorial

Is it ironic that a blog posting about GIMP should be letting applications like GIMP take a holiday โ€ฆ Tahiti sounds good โ€ฆ while CSS styling can take front stage with todayโ€™s improvements on the recent Gimp Guillotine Follow Up Border and Multiple Image Background Tutorial adding some image filter โ€œsmartsโ€ today, given that GIMP can achieve this too?

These CSS filters (we use on our HTML div and img elements) are amazing, and we talked about them at some length with CSS3 Filters Primer Tutorialโ€™>CSS3 Filters Primer Tutorial some time back, as much as anything because you can achieve just great affects just with a couple of lines of CSS code.

Up to now with our PHP based โ€œGIMP Guillotine Follow Upโ€ web application weโ€™ve concentrated on either Javascript DOM or inline CSS (via an HTML elementโ€™s style property) to get things achieved with the imagery perhaps output via the GIMP Guillotine technique โ€ฆ though we never said you HAD to use GIMP Guillotine, as you are just asked for any old imagery file specification โ€ฆ here. But the fact is, serverside languages such as PHP sit a layer on top of all client (webpage) HTML and Javascript and CSS considerations, so just as we think PHP and Javascript are the best of pals, depending on how you and PHP arrange the cocktail party seating arrangements, Iโ€™ve seen many a party where PHP and CSS get schloshed together with nairy a bad word spoken โ€ฆ though have seen some sideways glances from Ajax under the kitchen sink.

Example CSS image filter URLs and example executions follow โ€ฆ

Yet again we hope you can see more of what we mean by trying out the liveโœ‚runโ€˜s PHP gimp_guillotine_followupโšซphp today changed in thisway.


Previous relevant Gimp Guillotine Follow Up Border and Multiple Image Background Tutorial is shown below.

Gimp Guillotine Follow Up Border and Multiple Image Background Tutorial

Gimp Guillotine Follow Up Border and Multiple Image Background Tutorial

Developing on the work of the previous Gimp Guillotine Follow Up CSS keyframes Transition Tutorial today we add to the functionalities with โ€ฆ

  • multiple background image div element display (via background-image: url([dataURIimage]) // the Javascript DOM equivalent, that is) โ€ฆ and โ€ฆ
  • random animated border image to div element display (via border-image-source: url([dataURIimage]) // the Javascript DOM equivalent, that is)

โ€ฆ still calling on our data URL ways, so keeping it โ€œmobileโ€ manperson and (email attachment) โ€œtransportableโ€ M.A.N.good buddy โ€ฆ roger that.

No multiple image borders? Yes, our research here plucked out this small disappointment, so we found the next best thing to do (with the multiple images available) was to at least randomly animate these border images via Javascript setTimeout timer calls.

With the โ€œmultiple background image div element displayโ€ you also need to attend to โ€ฆ

  • background-repeat: no-repeat; // the Javascript DOM equivalent, that is
  • background-position: [leftOffset]px [topOffset]px; // the Javascript DOM equivalent, that is

โ€ฆ to not have the background images bunch themselves up in a muddled way.

To vary the โ€œrandom animated border image to div element displayโ€ you can optionally attend to โ€ฆ

  • border-image-width: [width]px; // the Javascript DOM equivalent, that is
  • border-image-slice: [slice]px; // the Javascript DOM equivalent, that is

โ€ฆ that you can see in action code-wise with Javascript โ€ฆ



var xob=null,xbvsb='';

function zworkit() {

xworkit(xob,xbvsb);

}

function xworkit(ob,bvsb) {

var bretval='', cretval='', dretval='', bcomma='', bchoice=Math.floor(Math.random() * 200), bslice=Math.floor(Math.random() * 100);

var mr=Math.floor(Math.random() * xparlist.length);

for (ixparlist=0; ixparlist<xparlist.length; ixparlist++) {

if (bvsb == 'border') {

if (ixparlist == mr) {

ob.style.borderImageWidth='' + bchoice + 'px';

ob.style.borderImageSlice='' + bslice + 'px';

ob.style.borderRepeat='repeat';

bretval+=bcomma + " url('" + document.getElementById(xparlist[ixparlist]).src + "')";

if (xob != null) {

ob.style.borderImageSource=" url('" + document.getElementById(xparlist[ixparlist]).src + "')";

}

xob=ob;

xbvsb=bvsb;

setTimeout(zworkit, 4000);

}

} else {

cretval+=bcomma + ' no-repeat';

dretval+=bcomma + ' ' + eval(-20 + eval('' + document.getElementById('lefttop').value.split(',')[eval(ixparlist * 2)])) + 'px ' + eval(-20 + eval('' + document.getElementById('lefttop').value.split(',')[eval(ixparlist * 2 + 1)])) + 'px';

bretval+=bcomma + " url('" + document.getElementById(xparlist[ixparlist]).src + "')";

bcomma=',';

}

}

if (cretval != '') {

ob.style.backgroundRepeat=cretval;

ob.style.backgroundPosition=dretval;

}

return bretval;

}

We hope you can see more of what we mean by trying out the liveโœ‚runโ€˜s PHP gimp_guillotine_followupโšซphp today changed in thisway.


Previous relevant Gimp Guillotine Follow Up CSS keyframes Transition Tutorial is shown below.

Gimp Guillotine Follow Up CSS keyframes Transition Tutorial

Gimp Guillotine Follow Up CSS keyframes Transition Tutorial

A while back we presented a series of web application ideas that do away with Javascript (ie. only needing HTML and CSS) to perform some functionality of interest. In that series we finished up with Missing Javascript Audio on Unmute Tutorial where through this series we touched on โ€ฆ

โ€ฆ and these feature today with our functionality extensions to yesterdayโ€™s Gimp Guillotine Follow Up PDF Slideshow and Video Tutorial where, again, we have a โ€˜piece of code modelled on a big long โ€œtemplateโ€ piece of HTML that we make substitutions into to create the functionalityโ€™.

We found that this was all fine and good to create an overall animation โ€œblobโ€ of webpage activity, but what was in that โ€œtemplateโ€ didnโ€™t help reflect GIMP Guillotine left and top โ€œoffsetsโ€ within that animation. To do this with our HTML div element, this, along with the change of background content, made us introduce some Javascript DOM changes where โ€ฆ

  • [divObject].style.backgroundImage=โ€url(โ€˜โ€ + dataURIofImageVar + โ€œโ€˜)โ€;
  • [divObject].style.backgroundPosition=โ€™ โ€˜ + parent.document.getElementById(โ€˜lefttopโ€™).value.split(โ€˜,โ€™)[eval(iparlist * 2)] + โ€˜px โ€˜ + parent.document.getElementById(โ€˜lefttopโ€™).value.split(โ€˜,โ€™)[eval(iparlist * 2 + 1)] + โ€˜pxโ€™;

โ€ฆ as in the Javascript function controlled by setTimeout timer calls (to help animate) โ€ฆ



var parlist=['mondrian-1504681_640-0-0png','mondrian-1504681_640-1-0png','mondrian-1504681_640-2-0png','mondrian-1504681_640-2-1png','mondrian-1504681_640-2-2png'];

var divo=null;

var iparlist=0;

function workit() {

if (divo == null) {

divo=document.getElementsByTagName('div')[0];

}

if (iparlist >= parlist.length) iparlist=0;

divo.style.backgroundRepeat='no-repeat';

divo.style.backgroundPosition=' ' + parent.document.getElementById('lefttop').value.split(',')[eval(iparlist * 2)] + 'px ' + parent.document.getElementById('lefttop').value.split(',')[eval(iparlist * 2 + 1)] + 'px';

divo.style.backgroundImage="url('" + parent.document.getElementById(parlist[iparlist]).src + "')";

iparlist++;

setTimeout(workit, 6000);

}

setTimeout(workit, 500);

โ€ฆ the act of which starts the video below (if not playing click here for alternate playing method) โ€ฆ

Letโ€™s catch up with some more URLs showing (and sharing) some recent scenarios below โ€ฆ

Send email to rmetcalfe15@gmail.com of the 5 Piet Mondrian image jigsaw pieces shown with an Inhouse Slideshow as the downloadable attachment HTML of that email โ€ฆ
https://www.rjmprogramming.com.au/PHP/gimp_guillotine_followup.php?filespec=.%2Fmondrian-1504681_640-*-*.*g*%23rmetcalfe15%40gmail.com%2B&include=&inhouseslideshow=Process+with+Inhouse+Slideshow#inhouseslideshowd
Send email to rmetcalfe15@gmail.com of the 5 Piet Mondrian image jigsaw pieces shown with an CSS keyframes Transition Animation as the downloadable attachment HTML of that email โ€ฆ
https://www.rjmprogramming.com.au/PHP/gimp_guillotine_followup.php?filespec=.%2Fmondrian-1504681_640-*-*.*g*%23rmetcalfe15%40gmail.com%2B&include=&transition=Process+with+keyframe+Transition+CSS+Animation
Show with an Inhouse Slideshow โ€ฆ
https://www.rjmprogramming.com.au/PHP/gimp_guillotine_followup.php?filespec=.%2Fmondrian-1504681_640-*-*.*g*&include=&inhouseslideshow=Process+with+Inhouse+Slideshow#inhouseslideshowd
Show with CSS keyframes Transition Animation โ€ฆ
https://www.rjmprogramming.com.au/PHP/gimp_guillotine_followup.php?filespec=.%2Fmondrian-1504681_640-*-*.*g*&include=&transition=Process+with+keyframe+Transition+CSS+Animation

Hopefully you can see more of what we mean at a liveโœ‚runโ€˜s PHP gimp_guillotine_followupโšซphp today changed in thisway.


Previous relevant Gimp Guillotine Follow Up CSS keyframes Transition Tutorial is shown below.

Gimp Guillotine Follow Up PDF Slideshow and Video Tutorial

Gimp Guillotine Follow Up PDF Slideshow and Video Tutorial

As the blog posting title intimates, adding onto yesterdayโ€™s Gimp Guillotine Follow Up Javascript DOM Animation Tutorial, todayโ€™s work looks at functionality to help create โ€ฆ

  • PDF slideshow
  • Inhouse style slideshow
  • Video

โ€ฆ and the top and bottom of these depend on, respectively, the amazing, the stupendous โ€ฆ

โ€ฆ that are looked for on the operating system (or web server) you are running the Gimp Guillotine Follow Up web application from, and if found offer HTML input type=submit methods of submitting the image file specification form.

Weโ€™ve talked about the fade in, fade out style of ffmpeg video before when we presented Firefox Inspector Debugging via Network Tab Primer Tutorial but today with variability within image sizes we found the additional switches like in the command below, necessary โ€ฆ



ffmpeg -loop 1 -t 5 -i /Applications/MAMP/htdocs/mondrian-1504681_640-0-0.png -loop 1 -t 5 -i /Applications/MAMP/htdocs/mondrian-1504681_640-1-0.png -loop 1 -t 5 -i /Applications/MAMP/htdocs/mondrian-1504681_640-2-0.png -loop 1 -t 5 -i /Applications/MAMP/htdocs/mondrian-1504681_640-2-1.png -loop 1 -t 5 -i /Applications/MAMP/htdocs/mondrian-1504681_640-2-2.png -filter_complex "[0:v]scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2,setsar=1,fade=t=out:st=4:d=1[v0]; [1:v]scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2,setsar=1,fade=t=in:st=0:d=1,fade=t=out:st=4:d=1[v1]; [2:v]scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2,setsar=1,fade=t=in:st=0:d=1,fade=t=out:st=4:d=1[v2]; [3:v]scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2,setsar=1,fade=t=in:st=0:d=1,fade=t=out:st=4:d=1[v3]; [4:v]scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2,setsar=1,fade=t=in:st=0:d=1,fade=t=out:st=4:d=1[v4]; [v0][v1][v2][v3][v4]concat=n=5:v=1:a=0,format=yuv420p[v]" -map "[v]" /Applications/MAMP/htdocs/gimp_guillotine.mp4

โ€ฆ resulting in (if not playing click here for alternate playing method) โ€ฆ

The PDF slideshow creation is a doddle for ImageMagick, an example of a command line (via PHP exec) command being โ€ฆ



convert /Applications/MAMP/htdocs/mondrian-1504681_640-0-0.png /Applications/MAMP/htdocs/mondrian-1504681_640-1-0.png /Applications/MAMP/htdocs/mondrian-1504681_640-2-0.png /Applications/MAMP/htdocs/mondrian-1504681_640-2-1.png /Applications/MAMP/htdocs/mondrian-1504681_640-2-2.png /Applications/MAMP/htdocs/gimp_guillotine.pdf

โ€ฆ resulting in (if not showing click here for alternate method) โ€ฆ

And our Internal Slideshow is a piece of code modelled on a big long โ€œtemplateโ€ piece of HTML that we make substitutions into to create the functionality (so click relevant button to make this happen) โ€ฆ

Again, we hope you can see more of what we mean at a liveโœ‚runโ€˜s PHP gimp_guillotine_followupโšซphp today changed in thisway.


Previous relevant Gimp Guillotine Follow Up Javascript DOM Animation Tutorial is shown below.

Gimp Guillotine Follow Up Javascript DOM Animation Tutorial

Gimp Guillotine Follow Up Javascript DOM Animation Tutorial

Adding to yesterdayโ€™s Gimp Guillotine Follow Up Email Attachment Tutorial we now want to add an โ€œonions of the 4th dimensionโ€ layer on top โ€œfeelโ€ to all this, by starting to think about animation functionality. Weโ€™re going to start out quite simply, and the simplest animation approach we can think of is โ€ฆ

  • have access to a bunch of image data URIs โ€ฆ check โ€ฆ
  • either โ€ฆ
    1. progressively show โ€ฆ or โ€ฆ
    2. one at a time show

    โ€ฆ this imagery at a point of time as a (pseudo Javascript) โ€ฆ


    document.body.backgroundImage="URL('" + thatDataURIVar + "')"


    โ€ฆ idea the timing of which can be controlled by the Javascript setTimeout timer method

As you can imagine โ€œone at a timeโ€ is a relative doddle, but โ€œprogressively showโ€ is not quite such a doddle. But it is an uncleโ€™s doddle if ahead of time you had โ€ฆ

  1. set up an array and an index variable pointing to a relevant index into it โ€ฆ


    var canvascset=[];

    var icanvascset=0;

    var elem=document.getElementById('mycanvas');

    var context=elem.getContext('2d');

  2. wherever in the code as it was, you had used the [canvasContext].drawImage you canvascset.push([thatCommand]) adding onto that array as per โ€ฆ


    canvascset.push("context.drawImage(ourdocumentgetElementById('img" + eval(-1 + myimagec.split(',' + pfix + '-' + icol + '-' + irow + ext)[0].split(',').length) + "'), " + left + "," + top + ");");

    context.drawImage(ourdocumentgetElementById('img' + eval(-1 + myimagec.split(',' + pfix + '-' + icol + '-' + irow + ext)[0].split(',').length)), left, top);

  3. then set up some โ€œaโ€ links using the Javascript function featuring setTimeout timing functionality, and good olโ€™ eval as per โ€ฆ


    function canvasanimation() {

    if (canvascset.length > 0 && icanvascset >= 0) {

    if (icanvascset <= 0) {

    icanvascset=0;

    context.clearRect(0, 0, elem.width, elem.height);

    eval(canvascset[0]);

    document.body.style.backgroundImage=\"url('\" + elem.toDataURL() + \"')\";

    icanvascset++;

    if (clearalot) {

    setTimeout(canvasanimation, 600);

    } else {

    setTimeout(canvasanimation, 3000);

    }

    } else if (icanvascset > canvascset.length) {

    icanvascset=0;

    if (clearalot) {

    setTimeout(canvasanimation, 1200);

    } else {

    setTimeout(canvasanimation, 6000);

    }

    } else {

    if (clearalot) context.clearRect(0, 0, elem.width, elem.height);

    eval(canvascset[icanvascset]);

    document.body.style.backgroundImage=\"url('\" + elem.toDataURL() + \"')\";

    icanvascset++;

    if (clearalot) {

    setTimeout(canvasanimation, 600);

    } else {

    setTimeout(canvasanimation, 3000);

    }

    }

    } else if (canvascset.length > 0) {

    icanvascset=0;

    }

    }


    โ€ฆ noting how the animations can be stopped by setting that indexing variable negative (at other functionality events)

The joy of this Javascript DOM animation approach is that the creation of any new media is avoided, hence our assertion that this is perhaps the easiest animation idea we can think of. More to come, though.


Previous relevant Gimp Guillotine Follow Up Email Attachment Tutorial is shown below.

Gimp Guillotine Follow Up Email Attachment Tutorial

Gimp Guillotine Follow Up Email Attachment Tutorial

Weโ€™ve got some good news for followers of the latest thread of blog postings following up on Gimp Guillotine usage thoughts as exemplified by yesterdayโ€™s Gimp Guillotine Follow Up Table and Image Map Tutorial efforts. Up to today, the โ€œaccountabilityโ€ score was not so great without a live run opportunity to show you what we mean. But today weโ€™ve decided to open up all but the โ€œGIMP Listeningโ€ aspects of this web application live to the rjmprogramming.com.au domain. Why the change of heart? Well, now itโ€™s worth it, with the sharing email dual options โ€ฆ

  • email a canvas element based overall image view as an email attachment โ€ฆ as well as, now, by appending a โ€œ+โ€ to your email declaration โ€ฆ
  • email all that you are seeing on the screen at the time as an email attachment

โ€ฆ because, now, we believe we have a useful enough โ€œtoolโ€ for collaboration purposes, not that we are saying it is no longer a โ€œuse this PHP with a local web server like MAMPโ€ proposition as well. It is, but you can learn a bit in advance trying out what youโ€™ve been seeing us talk about here over the last few days, because weโ€™ve also uploaded to the rjmprogramming.com.au domain those Piet Mondrian inspired image jigsaw parts which Pixabay webpage, thanks, helped us create via GIMPโ€™s โ€œImage -> Transform -> Guillotineโ€ functionality quite a few days ago now.

The other issue which makes all this feasible is the involvement of PHP (though perhaps HTML and Javascript and Ajax might swing it too) being able to express the web applicationโ€™s image (img elements) totally as data URIs, and so be totally mobile and transportable to email with HTML email attachments, which continue their functionality, being as they donโ€™t require the http nor https protocol absolute URL need.

Another aspect that might have been gnawing away at the patience of people following this blog posting thread was the dumbness of the HTML textarea element weโ€™d presented as a displayer of image jigsaw filename information. To us, to make this part of the web application much more useful was to turn the HTML textarea element into an HTML select (dropdown) โ€œmultipleโ€ mode element which allows the user to work with the โ€œdisplay subsetโ€ of the whole set (though behind the scenes they are all there courtesy of the CSS usage of visibility:hidden; (leaving in whitespace) rather than display:none; (scrunching up whitespace) styling which you can read more about at CSS Style Display and Visibility Tall Poppies Tutorial) as well.

This all means we can show you some URLs showing (and sharing) some of these scenarios below too, which we will now, rather than later โ€ฆ know youโ€™re in a hurry โ€ฆ

Send email to rmetcalfe15@gmail.com of the 5 Piet Mondrian image jigsaw pieces shown with a canvas based background image all as the downloadable attachment HTML of that email โ€ฆ
https://www.rjmprogramming.com.au/PHP/gimp_guillotine_followup.php?filespec=.%2Fmondrian-1504681_640-*-*.*g*%23rmetcalfe15%40gmail.com%2B&include=&canvasnorepeat=Process+with+Canvas+Background+Image+No+Repeat
Send email to rmetcalfe15@gmail.com of the first and second and fourth of the 5 Piet Mondrian image jigsaw pieces shown with a div margin based background image all as the downloadable attachment HTML of that email โ€ฆ
https://www.rjmprogramming.com.au/PHP/gimp_guillotine_followup.php?filespec=.%2Fmondrian-1504681_640-*-*.*g*%23rmetcalfe15%40gmail.com%2B&include=.%2Fmondrian-1504681_640-0-0.png%2C.%2Fmondrian-1504681_640-1-0.png%2C.%2Fmondrian-1504681_640-2-1.png&divmarginuse=Process+with+Top+Div+Margin+Use
Show with a canvas based background image โ€ฆ
https://www.rjmprogramming.com.au/PHP/gimp_guillotine_followup.php?filespec=.%2Fmondrian-1504681_640-*-*.*g*&include=&canvasnorepeat=Process+with+Canvas+Background+Image+No+Repeat
Show with the first and second and fourth of the 5 Piet Mondrian image jigsaw pieces shown with a div margin based background image, and below that as an iframe view โ€ฆ
https://www.rjmprogramming.com.au/PHP/gimp_guillotine_followup.php?filespec=.%2Fmondrian-1504681_640-*-*.*g*&include=.%2Fmondrian-1504681_640-0-0.png%2C.%2Fmondrian-1504681_640-1-0.png%2C.%2Fmondrian-1504681_640-2-1.png&divmarginuse=Process+with+Top+Div+Margin+Use

We hope you can see more of what we mean at a liveโœ‚runโ€˜s PHP gimp_guillotine_followupโšซphp today changed in thisway.


Previous relevant Gimp Guillotine Follow Up Table and Image Map Tutorial is shown below.

Gimp Guillotine Follow Up Table and Image Map Tutorial

Gimp Guillotine Follow Up Table and Image Map Tutorial

The recent Gimp Guillotine Follow Up Canvas Tutorial had us with โ€œjigsaw pieced togetherโ€ image representations for โ€ฆ

  • Div Margin
  • Canvas

โ€ฆ and today we add to that โ€ฆ

  • Table
  • Image Map

โ€ฆ inspired by existant GIMP functionalities, respectively โ€ฆ

  • Filters -> Web -> Sliceโ€ฆ
  • Filters -> Web -> Image Mapโ€ฆ

We service these new functionalities by new โ€œaโ€ link hashtags. We also add to the viewing adaptability by encasing all these display options within the (introduced with HTML5) details tag and its nested summary tag โ€œrevealersโ€. These great HTML elements can help clarify situations where there are many choices but the user is in all likelihood wanting to focus on just one at a time. These details/summary tags are initially set โ€œclosedโ€ for lack of clutter but as a user clicks on an associated โ€œaโ€ link hashtag they are โ€œopenedโ€ on the fly via (the (pseudo) Javascript) โ€ฆ



document.getElementById([detailTagObjectID]).open=true;

So see how we got to the new PHP gimp_guillotine_followupโšซphp today changed in thisway and, again, it is more than likely you will use this PHP with a local web server like MAMP.


Previous relevant Gimp Guillotine Follow Up Canvas Tutorial is shown below.

Gimp Guillotine Follow Up Canvas Tutorial

Gimp Guillotine Follow Up Canvas Tutorial

The second of the non-primer tutorial themes to improve and build on yesterdayโ€™s Gimp Guillotine Follow Up Div Margin Tutorial โ€ฆ



HTML div element housing HTML img elements (no position: absolute like we like so much for overlay work) using style property margin-left and HTML br (line break) element (which sometimes requires negative margin-top tweaking)

โ€ฆ involves the ever useful canvas element introduced with HTML5 as per โ€ฆ



HTML canvas element object's drawImage method helps draw HTML img elements positionally so as to recreate the original image look from constituent "jigsaw image element" HTML img elements

Letโ€™s take a step back, reread Emoji Border or Background Image Canvas Tutorial โ€ฆ

Whatโ€™s the big deal with the HTML5 canvas element? For a few things โ€ฆ

  • the HTML5 canvas element right click or two finger gesture functionality includes Copy options โ€ฆ
  • the canvas can collect both images and text and be able to summarize that into โ€ฆ
  • a single image can be derived from the canvas element, encapsulating its contents โ€ฆ so that โ€ฆ
  • the canvas element can export that graphical content into a data URI that involves no absolute URLs โ€ฆ and so ties in nicely with โ€ฆ
  • email attachments can go hand in hand with the canvas element via a serverside function such as PHPโ€™s mail function to enhance sharing functionalities

โ€ฆ because it is both pertinent to this project and shows how the canvas element is such a great generic โ€œgraphicโ€ sharing element. Express all its content by data URIs and you have a totally โ€œmobileโ€ and transportable container of graphical or pixel data.

The PHP gimp_guillotine_followupโšซphp today changed for canvas use thisway and it is more than likely you will use this PHP with a local web server like MAMP. We hope this gives you ideas, and please feel free to download this PHP.


Previous relevant Gimp Guillotine Follow Up Div Margin Tutorial is shown below.

Gimp Guillotine Follow Up Div Margin Tutorial

Gimp Guillotine Follow Up Div Margin Tutorial

The first non-primer tutorial theme to improve and build on the recent Gimp Guillotine Follow Up Primer Tutorial are a series of representations to put the Gimp Guillotine โ€œjigsaw image piecesโ€ back together to make humpty dumpty โ€ฆ down, Nala โ€ฆ representations of the original image back for the user. Sounds a bit counterproductive, but these are all steps in a process to eventually be able to do quite a bit we hope. Todayโ€™s โ€œfirst cab off the rankโ€ representation is โ€ฆ



HTML div element housing HTML img elements (no position: absolute like we like so much for overlay work) using style property margin-left and HTML br (line break) element (which sometimes requires negative margin-top tweaking)

Gasp, how rudimentary! But sometimes the rudimentary things are the best. We display this โ€œpieced back together original imageโ€ data (from the data you guillotined (which may not be the whole picture, as with todayโ€™s data we test)) in three different ways โ€ฆ

  • an โ€œaโ€ link hashtag navigates the user below the fold to the โ€œpieced back together original imageโ€
  • another โ€œaโ€ link hashtag navigates the user to a new window with the โ€œpieced back together original imageโ€
  • a new type=submit name=divmarginuse button of the HTML form is an alternate processing option that automatically โ€œunderlaysโ€ (you say underlay, I say overlay, we go) the โ€œpieced back together original imageโ€ under whatever webpage data appears at the top left, with an opacity less than 1 (ie. 0.5 to show with some transparency), this โ€œunderlayโ€ being position:absolute but not asking that of an pre-existant webpage data โ€ฆ it is added dynamically via Javascript DOM techniques

This last optionโ€™s usage we find pretty efficient, and you can read more on this at HTML Multiple Form Multiple Submit Buttons Primer Tutorial. As you might surmise, weโ€™ll be adding more of these as time goes on, and we dip our toes into the myriad number of representations of this โ€œpieced back together original imageโ€ data we visit.

The PHP gimp_guillotine_followupโšซphp today changed thisway it is more than likely you will use this PHP with a local web server like MAMP (though into the future we may offer a command line mode of use).

Hopefully todayโ€™s tutorial picture makes what we are talking about here more clear for you.


Previous relevant Gimp Guillotine Follow Up Primer Tutorial is shown below.

Gimp Guillotine Follow Up Primer Tutorial

Gimp Guillotine Follow Up Primer Tutorial

Still on yesterdayโ€™s Gimp Image Map HTML Primer Tutorialโ€˜s Gimp themes do you remember us saying, relating to GIMP โ€ฆ

โ€ฆ precursor to being able to break an image into component parts via โ€œImage -> Transform -> Guillotineโ€ or the more enticing, for those web developers out there, โ€œFilters -> Web -> Sliceโ€ which effectively does what Guillotine does and writes out some HTML in the form of an HTML table element that includes some โ€œaโ€ link opportunities to do something special for individual images of the new โ€œimage jigsawโ€ surrounded by Guides

โ€ฆ down below? Well, yes, today is a revisit to the โ€œGuillotineโ€ bit of that, because it is all well and good to use โ€œFilters -> Web -> Sliceโ€ for a fait accompli HTML table โ€œslicingโ€ approach, but as you can imagine, there are lots of reasons, such as responsive design, why you might want to stop at the โ€œGuillotineโ€ โ€œjust give me the images, manpersonโ€ stage and from there, do your own thingthang, manperson.

Weโ€™re just starting down the road of this today in our โ€œPrimerโ€ tutorial, just being able to either โ€ฆ

  1. image creation method โ€ฆ
    • start GIMP and listen out for new images created โ€ฆ weโ€™re hoping via โ€œImage -> Transform -> Guillotineโ€ โ€ฆ or โ€ฆ
    • specify your own filespec of images โ€ฆ weโ€™re hoping got there via โ€œImage -> Transform -> Guillotineโ€
  2. list those image files โ€ฆ
  3. show those image files

GIMP being a desktop application, you might have guessed that weโ€™d use a serverside language for this work, and yes, weโ€™re using PHP gimp_guillotine_followupโšซphp today, but donโ€™t show you any live run links because it is more than likely you will use this PHP with a local web server like MAMP (though into the future we may offer a command line mode of use).

So please feel free to download that PHP and/or see its approach via todayโ€™s tutorial picture.


Previous relevant Gimp Image Map HTML Primer Tutorial is shown below.

Gimp Image Map HTML Primer Tutorial

Gimp Image Map HTML Primer Tutorial

As we intimated yesterday with Gimp Guides to HTML Primer Tutorial regarding the GIMP image editorโ€™s โ€œFilters -> Webโ€ menu โ€ฆ

โ€ฆ you would also see an โ€œImage Mapโ€ option helping out in a similar fashion to the stupendous mobilefish functionality.

โ€ฆ and so we are here today to show you how that functionality works via a PDFโœ‚slideshow for your perusal. There are options to shape what goes into the resultant HTMLโ€™s map elementโ€™s area (as rectangle or ellipse or polygon) tag href property link types as per โ€ฆ

โ€ฆ as a very extensive ideas list on top of options to define event logic for โ€ฆ

  • onmouseover
  • onmouseout
  • onfocus
  • onblur

โ€ฆ and that there is the option to define exact co-ordinates, and to define the alt attribute and HTML iframe name as applicable, also.

Weโ€™ll leave you with the resultant HTML we had GIMP create for us as a result of the goings on in that PDF slideshow (noting that the only adjustment to HTML in out TextWrangler editing session was to point at the image img element src attribute location properly), and we hope this is of benefit for you โ€ฆ



<img src="mondrian-1504681_640.jpg" width="640" height="480" border="0" usemap="#map" />

 

<map name="map">

<!-- #$-:Image map file created by GIMP Image Map plug-in -->

<!-- #$-:GIMP Image Map plug-in by Maurits Rijk -->

<!-- #$-:Please do not edit lines starting with "#$" -->

<!-- #$VERSION:2.3 -->

<!-- #$AUTHOR:User -->

<area shape="rect" coords="0,1,36,132" href="mailto:?body=w_1_1&subject=Mondrian%20Composition%20with%20Read%20Yellow%20and%20Blue" />

<area shape="rect" coords="51,0,118,128" href="mailto:?body=y_2_1&subject=Mondrian%20Composition%20with%20Red%20Yellow%20and%20Blue" />

<area shape="rect" coords="136,1,295,133" href="mailto:?body=b_3_1&subject=Mondrian%20Composition%20with%20Red%20Yellow%20and%20Blue" />

<area shape="rect" coords="310,1,500,132" href="mailto:?body=r_4_1&subject=Mondrian%20Composition%20with%20Red%20Yellow%20and%20Blue" />

<area shape="rect" coords="514,0,566,131" href="mailto:?body=y_5_1&subject=Mondrian%20Composition%20with%20Red%20Yellow%20and%20Blue" />

<area shape="rect" coords="583,1,596,130" href="mailto:?body=w_6_1&subject=Mondrian%20Composition%20with%20Red%20Yellow%20and%20Blue" />

<area shape="rect" coords="0,146,36,293" href="mailto:?body=w_1_2&subject=Mondrian%20Composition%20with%20Red%20Yellow%20and%20Blue" />

<area shape="rect" coords="50,145,119,294" href="mailto:?body=w_2_2&subject=Mondrian%20Composition%20with%20Red%20Yellow%20and%20Blue" />

<area shape="rect" coords="134,146,295,292" href="mailto:?body=w_3_2&subject=Mondrian%20Composition%20with%20Red%20Yellow%20and%20Blue" />

<area shape="rect" coords="310,146,375,294" href="mailto:?body=w_4_2&subject=Mondrian%20Composition%20with%20Red%20Yellow%20and%20Blue" />

<area shape="rect" coords="391,147,498,294" href="mailto:?body=w_5_2&subject=Mondrian%20Composition%20with%20Red%20Yellow%20and%20Blue" />

<area shape="rect" coords="514,144,567,294" href="mailto:?body=r_6_2&subject=Mondrian%20Composition%20with%20Red%20Yellow%20and%20Blue" />

<area shape="rect" coords="582,146,597,385" href="mailto:?body=w_7_2&subject=Mondrian%20Composition%20with%20Red%20Yellow%20and%20Blue" />

<area shape="rect" coords="0,309,36,479" href="mailto:?body=w_1_3&subject=Mondrian%20Composition%20with%20Red%20Yellow%20and%20Blue" />

<area shape="rect" coords="51,308,119,386" href="mailto:?body=w_2_3&subject=Mondrian%20Composition%20with%20Red%20Yellow%20and%20Blue" />

<area shape="rect" coords="133,307,374,385" href="mailto:?body=r_3_3&subject=Mondrian%20Composition%20with%20Red%20Yellow%20and%20Blue" />

<area shape="rect" coords="390,307,499,385" href="mailto:?body=w_4_3&subject=Mondrian%20Composition%20with%20Red%20Yellow%20and%20Blue" />

<area shape="rect" coords="514,309,569,384" href="mailto:?body=y_5_3&subject=Mondrian%20Composition%20with%20Red%20Yellow%20and%20Blue" />

<area shape="rect" coords="51,399,118,481" href="mailto:?body=b_2_4&subject=Mondrian%20Composition%20with%20Red%20Yellow%20and%20Blue" />

<area shape="rect" coords="132,400,375,479" href="mailto:?body=y_3_4&subject=Mondrian%20Composition%20with%20Red%20Yellow%20and%20Blue" />

<area shape="rect" coords="390,400,568,481" href="mailto:?body=w_4_4&subject=Mondrian%20Composition%20with%20Red%20Yellow%20and%20Blue" />

<area shape="rect" coords="582,399,597,479" href="mailto:?body=w_5_4&subject=Mondrian%20Composition%20with%20Red%20Yellow%20and%20Blue" />

</map>


Previous relevant Gimp Guides to HTML Primer Tutorial is shown below.

Gimp Guides to HTML Primer Tutorial

Gimp Guides to HTML Primer Tutorial

The great GIMP image editor has several ways to create Guides, which are the precursor to being able to break an image into component parts via โ€œImage -> Transform -> Guillotineโ€ or the more enticing, for those web developers out there, โ€œFilters -> Web -> Sliceโ€ which effectively does what Guillotine does and writes out some HTML in the form of an HTML table element that includes some โ€œaโ€ link opportunities to do something special for individual images of the new โ€œimage jigsawโ€ surrounded by Guides. Within the options of that last menu you would also see an โ€œImage Mapโ€ option helping out in a similar fashion to the stupendous mobilefish functionality.

With this in mind, we almost immediately thought of the great Piet Mondrian and his rectangle paintings in primary colours, wondering if by now you could get image downloads of his work, given he died some time ago now. And yes, there at this Pixabay webpage, thanks, we were able to do that and download an image version of โ€œComposition with Red Yellow and Blueโ€ to open with GIMP.

Which ways, then, in GIMP, can you create Guides?

  • precise Horizontal or Vertical position specification in pixels (via Image -> Guides -> New Guideโ€ฆ) or percentage (via Image -> Guides -> New Guide (by Percent)โ€ฆ) values
  • position via a Selection (via Image -> Guides -> New Guides from Selection) โ€ฆ and todayโ€™s method of choice โ€ฆ
  • user long hover then drag of the rulers at the top and left for dynamic Horizontal and Vertical Guides respectively

Best for this is that you can see us doing this with YouTube video we made for the purpose on our MacBook Pro using QuickTime Player โ€œFile -> New Screen Recordingโ€ resultant presentation you can play below.

โ€ฆ and the resultant HTML code snippet, including our bits, produced looked like โ€ฆ



<!--HTML SNIPPET GENERATED BY GIMP

 

WARNING!! This is NOT a fully valid HTML document, it is rather a piece of

HTML generated by GIMP's py-slice plugin that should be embedded in an HTML

or XHTML document to be valid.

 

Replace the href targets in the anchor (<a >) for your URLS to have it working

as a menu.

 

 

Thanks for viewing.


-->

<table cellpadding="0" border="0" cellspacing="0">

<tr>

<td><img alt=" " src="blue_0_0.jpg" style="width: 51px; height: 4px; border-width: 0px;"></td>

<td><img alt=" " src="blue_0_1.jpg" style="width: 70px; height: 4px; border-width: 0px;"></td>

<td><img alt=" " src="blue_0_2.jpg" style="width: 11px; height: 4px; border-width: 0px;"></td>

<td><img alt=" " src="blue_0_3.jpg" style="width: 164px; height: 4px; border-width: 0px;"></td>

<td><img alt=" " src="blue_0_4.jpg" style="width: 95px; height: 4px; border-width: 0px;"></td>

<td><img alt=" " src="blue_0_5.jpg" style="width: 110px; height: 4px; border-width: 0px;"></td>

<td><img alt=" " src="blue_0_6.jpg" style="width: 139px; height: 4px; border-width: 0px;"></td>

</tr>

<tr>

<td><img alt=" " src="blue_1_0.jpg" style="width: 51px; height: 128px; border-width: 0px;"></td>

<td><a href="#"><img alt=" " src="blue_1_1.jpg" style="width: 70px; height: 128px; border-width: 0px;"></a></td>

<td><a href="#"><img alt=" " src="blue_1_2.jpg" style="width: 11px; height: 128px; border-width: 0px;"></a></td>

<td><a title='blue' onclick="alert('Am I blue?');" href="#"><img alt=" " src="blue_1_3.jpg" style="width: 164px; height: 128px; border-width: 0px;"></a></td>

<td><a href="#"><img alt=" " src="blue_1_4.jpg" style="width: 95px; height: 128px; border-width: 0px;"></a></td>

<td><a href="#"><img alt=" " src="blue_1_5.jpg" style="width: 110px; height: 128px; border-width: 0px;"></a></td>

<td><img alt=" " src="blue_1_6.jpg" style="width: 139px; height: 128px; border-width: 0px;"></td>

</tr>

<tr>

<td><img alt=" " src="blue_2_0.jpg" style="width: 51px; height: 14px; border-width: 0px;"></td>

<td><a href="#"><img alt=" " src="blue_2_1.jpg" style="width: 70px; height: 14px; border-width: 0px;"></a></td>

<td><a href="#"><img alt=" " src="blue_2_2.jpg" style="width: 11px; height: 14px; border-width: 0px;"></a></td>

<td><a href="#"><img alt=" " src="blue_2_3.jpg" style="width: 164px; height: 14px; border-width: 0px;"></a></td>

<td><a href="#"><img alt=" " src="blue_2_4.jpg" style="width: 95px; height: 14px; border-width: 0px;"></a></td>

<td><a href="#"><img alt=" " src="blue_2_5.jpg" style="width: 110px; height: 14px; border-width: 0px;"></a></td>

<td><img alt=" " src="blue_2_6.jpg" style="width: 139px; height: 14px; border-width: 0px;"></td>

</tr>

<tr>

<td><img alt=" " src="blue_3_0.jpg" style="width: 51px; height: 147px; border-width: 0px;"></td>

<td><a href="#"><img alt=" " src="blue_3_1.jpg" style="width: 70px; height: 147px; border-width: 0px;"></a></td>

<td><a href="#"><img alt=" " src="blue_3_2.jpg" style="width: 11px; height: 147px; border-width: 0px;"></a></td>

<td><a href="#"><img alt=" " src="blue_3_3.jpg" style="width: 164px; height: 147px; border-width: 0px;"></a></td>

<td><a href="#"><img alt=" " src="blue_3_4.jpg" style="width: 95px; height: 147px; border-width: 0px;"></a></td>

<td><a title='Blue' onclick="alert('Am i Blue?');" href="#"><img alt=" " src="blue_3_5.jpg" style="width: 110px; height: 147px; border-width: 0px;"></a></td>

<td><img alt=" " src="blue_3_6.jpg" style="width: 139px; height: 147px; border-width: 0px;"></td>

</tr>

<tr>

<td><img alt=" " src="blue_4_0.jpg" style="width: 51px; height: 107px; border-width: 0px;"></td>

<td><a href="#"><img alt=" " src="blue_4_1.jpg" style="width: 70px; height: 107px; border-width: 0px;"></a></td>

<td><a href="#"><img alt=" " src="blue_4_2.jpg" style="width: 11px; height: 107px; border-width: 0px;"></a></td>

<td><a href="#"><img alt=" " src="blue_4_3.jpg" style="width: 164px; height: 107px; border-width: 0px;"></a></td>

<td><a href="#"><img alt=" " src="blue_4_4.jpg" style="width: 95px; height: 107px; border-width: 0px;"></a></td>

<td><a href="#"><img alt=" " src="blue_4_5.jpg" style="width: 110px; height: 107px; border-width: 0px;"></a></td>

<td><img alt=" " src="blue_4_6.jpg" style="width: 139px; height: 107px; border-width: 0px;"></td>

</tr>

<tr>

<td><img alt=" " src="blue_5_0.jpg" style="width: 51px; height: 78px; border-width: 0px;"></td>

<td><a title='BLUE' onclick="alert('Am i BLUE?');" href="#"><img alt=" " src="blue_5_1.jpg" style="width: 70px; height: 78px; border-width: 0px;"></a></td>

<td><a href="#"><img alt=" " src="blue_5_2.jpg" style="width: 11px; height: 78px; border-width: 0px;"></a></td>

<td><a href="#"><img alt=" " src="blue_5_3.jpg" style="width: 164px; height: 78px; border-width: 0px;"></a></td>

<td><a href="#"><img alt=" " src="blue_5_4.jpg" style="width: 95px; height: 78px; border-width: 0px;"></a></td>

<td><a href="#"><img alt=" " src="blue_5_5.jpg" style="width: 110px; height: 78px; border-width: 0px;"></a></td>

<td><img alt=" " src="blue_5_6.jpg" style="width: 139px; height: 78px; border-width: 0px;"></td>

</tr>

<tr>

<td><img alt=" " src="blue_6_0.jpg" style="width: 51px; height: 2px; border-width: 0px;"></td>

<td><img alt=" " src="blue_6_1.jpg" style="width: 70px; height: 2px; border-width: 0px;"></td>

<td><img alt=" " src="blue_6_2.jpg" style="width: 11px; height: 2px; border-width: 0px;"></td>

<td><img alt=" " src="blue_6_3.jpg" style="width: 164px; height: 2px; border-width: 0px;"></td>

<td><img alt=" " src="blue_6_4.jpg" style="width: 95px; height: 2px; border-width: 0px;"></td>

<td><img alt=" " src="blue_6_5.jpg" style="width: 110px; height: 2px; border-width: 0px;"></td>

<td><img alt=" " src="blue_6_6.jpg" style="width: 139px; height: 2px; border-width: 0px;"></td>

</tr>

</table>

We hope you find these GIMP โ€œSlice and Diceโ€ webpage creation ideas of interest.

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.


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.


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.


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, Photography, Tutorials and tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

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