Gravatar like random image generator with 8bit styling
Switch branches/tags
Nothing to show
Clone or download
Permalink
Failed to load latest commit information.
LICENSE.md
README.md
avatar.php
index.html

README.md

Ratavarg (Gravatar backwards) is a PHP application written back in Aug/2013 when I was not pleased with the default image generated by Gravatar.com in response to the anonymity of my account. The thing is, I have no access to that (old) account anymore. The script uses the GD (GIF Draw) module to generate an image representing a grid of 5x5, fifteen of the squares at the left side are filled randomly with colors and the remaining ten squares at the right are copied from the first ten squares of the left side generating a simetric graphic.

Check a live demo here.

Usage

Add a HTML tag referencing the PHP file as the source of the image, the script will respond with the data generated and an image header forcing the browser to consider the file as an image.

<img src="/avatar.php" width="300" height="300" />

Use this configuration in the AccessFilename of your project to change the format of the image generated, the script will automatically understand what extension was requested, supported formats are: jpeg, gif, and png.

<IfModule mod_rewrite.c>
    RewriteEngine on
    # RewriteBase /

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteRule ^avatar.(png|jpg|gif)$ avatar.php [L]
</IfModule>

What is Gravatar?

According to Gravatar.com - What is Gravatar:

An avatar is an image that represents a person online, basically a little picture that appears next to your name when you interact with websites. A Gravatar is a Globally Recognized Avatar. You upload it and create your profile just once, and then when you participate in any Gravatar-enabled site, your Gravatar image will automatically follow you there.

Gravatar is a free service for site owners, developers, and users. It is automatically included in every WordPress account and is run and supported by Automattic.