PHP GD Image at Pixel Level Background Tutorial

PHP GD Image at Pixel Level Background Tutorial

PHP GD Image at Pixel Level Background Tutorial

Yesterday’s PHP GD Image at Pixel Level Primer Tutorial had us musing ….

Do you feel this web application has the genericity to be a “tool”? Spoiler alert … we think so.

… and so here we are, today, with the first idea regarding using that PHP code as a “tool”, a “background image iframe” tool, using two (of the usual “three amigos”, z-index having gone walkabout due to “relevance deprivation syndrome”, today) of our usual “overlay” suspects …

We encase yesterday’s PHP work into an HTML iframe “child” element, and rather than relying on the “parent” supervisory (and new) HTML pixellate.html to control opacity via the opacity of the HTML iframe element (which we may still allow for … we’ll see) we opt to make the “child” HTML iframe PHP be that little more flexible by allowing for pixellate.php change in this way to allow for a tailored calling mechanism regarding “opacity” via …

… that is user controllable via “&opacity=1.0″ type of URL bit where (1.0=opaque, 0.0=transparent) usage.

The parent’s job using this PHP “child” would be to set some transparency to an HTML “iframe” call of the PHP to cover the window, where we call into play the Javascript window.getComputedStyle method to resize the PHP “child” to full window dimensions, on the proviso that any parameters the user uses to call the “parent” HTML don’t override this “default” width and height of background image (ie. PHP “child” iframe) settings.

Guess the other job of the “parent” is to “mean” something, and so we write some content on the “theme” of “Lyrics of Songs about Stars” because the background image effects you get with the “pixellated” PHP GD calls remind us of the nighttime sky, and stars, and you can see this in action with today’s live run link.


Previous relevant PHP GD Image at Pixel Level Primer Tutorial is shown below.

PHP GD Image at Pixel Level Primer Tutorial

PHP GD Image at Pixel Level Primer Tutorial

A great place to start learning about the serverside language PHP is to read the webpage Image Processing and GD because PHP is great in so many ways regarding image creation and manipulation.

The GD methods (down to the pixel level, with the first one) we use are …

What we parameterize is …

  • width of image
  • height of image
  • density of pixels created
  • size of conglomeration of pixel (rectangular “blob”)

Today’s PHP code you can download via this pixellate.php link and try it via this live run link. We kind of like some of the images as below …

//www.rjmprogramming.com.au/PHP/pixellate.php?height=600&width=890&size=6&zeroes=4

//www.rjmprogramming.com.au/PHP/pixellate.php?height=600&width=890&size=8&zeroes=2

//www.rjmprogramming.com.au/PHP/pixellate.php?height=600&width=490

Do you feel this web application has the genericity to be a “tool”? Spoiler alert … we think so.

You can see this, also, at WordPress 4.1.1’s PHP GD Image at Pixel Level Primer Tutorial.

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

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>