Quantcast
Channel: Gigarocket Forum - All Forums
Viewing all articles
Browse latest Browse all 1923

[CODE] Random image generator for php (plus caching and gzip)

$
0
0
Last year I was studying basic database in my college and in the last assignment I had to develop a random image generator (short long history: I had to generate some profile pics for placeholder users to make the database huge). I made some changes before posting here, in the old version it would only draw circles inside the picture and in this it can generate circles and regular polygons with 3 or more sides. Also, I added more configuration variables and released under The Unlicense (means full public domain, so you can copy, edit, compress, expand, create, etc) on github.

It's fully commented for you and available on https://github.com/marco-xd/PHP-Random-Image.

If you want to understand more, you can PM me anytime or post here. Also, I recommend reading the following links:
You can pass the arguments via GET or let the code use random values. It accepts the following arguments:
  • seed: Random seed (string)
  • width: Image width
  • height: Image height
  • antialias: Image antialiasing (GD circles have a lot of aliasing)

These arguments are limited on the server-side so you cannot enter a huge value of width and use all of the computer memory.

Some results are attached below.

.png  image__width.1000_height.200_antialias.2.png (Size: 83.59 KB / Downloads: 1)

.png  image__width.1000_height.100_antialias.2_seed.gigarank.png (Size: 59.05 KB / Downloads: 1)

.png  image__width.500_height.100_antialias.3.png (Size: 42.66 KB / Downloads: 1)

.png  image__width.500_height.500_antialias.2.png (Size: 96.15 KB / Downloads: 1)

Viewing all articles
Browse latest Browse all 1923

Trending Articles