PHP Tutorials: Creating Images with PHP

Posted by: Admin  :  Category: Php

Linux Cpanel shared hosting: 600 GB disk space, 6 TB bandwidth, free domain, unlimited databases and ftp accounts, web hosting cheap and pro at Hostony

Linux Cpanel shared hosting: 600 GB disk space, 6 TB bandwidth, free domain, unlimited databases and ftp accounts, web hosting cheap and pro at Hostony

The fundamentals of creating an image in PHP using GD Library support. This tutorial shows you how to create a simple image with welcome text and a name to follow. For example, ‘Welcome to PHPAcademy, Alex’
Video Rating: 4 / 5

Linux Cpanel shared hosting: 600 GB disk space, 6 TB bandwidth, free domain, unlimited databases and ftp accounts, web hosting cheap and pro at Hostony

25 Responses to “PHP Tutorials: Creating Images with PHP”

  1. sneakylight Says:

    havij works better πŸ™‚ mediafire . com/?d4d9ackbidf77go

  2. DeDean16 Says:

    that’s pretty awesome πŸ˜€

  3. Acceptable76 Says:

    i love you alex – Acceptable67

  4. linuguddu Says:

    can we save this image directly and access that using

  5. linuguddu Says:

    @linuguddu : nothing appears in my php file body.

  6. linuguddu Says:

    really good tutorial.. but i have got one problem.. after doing this if i write anything in my html file’s body nothing appears on the screen accept for the image i created.

  7. JelvinJS7 Says:

    Ok. This…
    Looks EPIC!
    I’m on my iPod, but next time I get on the computer, I’m totally testing this! Adding to my website and changing my profile puc!
    Thanks man!

  8. wfareed Says:

    @alukiMreteP install the GD library and enable it in php.ini file to be able to use this function to manipulate images with php.

  9. Dolter9 Says:

    Cool Video Thanks! πŸ˜€

  10. justheretowatch2010 Says:

    @plutonimvamsi there where around 32 0r 33 characters to be displayed,and we show it fit perfectly in 300 width… 300/ that 9.3 is approx. width of each character…well that’s my opinion it could be wrong:)

  11. justheretowatch2010 Says:

    hey alex , i’m new to php so forgive me if my question stupid or anything…..
    i ran that code in opera 10.53 ,instead getting image at upper left corner i am getting the image at the center…why?

    by the way,great tuts:)

  12. plutonimvamsi Says:

    please tell how you used 9.3 ?

  13. tropicallanterns Says:

    I don’t understand how the background color is set. I see how $background is declared, but it’s not being used anywhere like $foreground is. Thx!

  14. abdulask Says:

    Thanks a Lot Alex, That Was One Wicked Tutorial… Keep Up The Great Work… and if you could please provide a bit more example on the GD Library.

  15. alukiMreteP Says:

    Nice video… But when I write this code and try to start it it I see this :
    Fatal error: Call to undefined function: imagecreate() in c:apachehtdocsgenerator.php on line 20
    Do you know what to do plls?

  16. bassatcollege Says:

    @omanoman98 9.3 is the width of each character, e.g “a” “b” “c” etc… and basically the strlen function counts how many characters there are in the message variable, and then the length variable multiplies the amount of characters by the width of the charaters, and gives you a dynamic width the picture should be πŸ™‚
    Hope this helps.

  17. VinnyBenson Says:

    Hey Alex, is there a way to set a chroma key, as I need to remove rgb(255,125,25) from my image

  18. brokenbylaw2 Says:

    Try OB_START();

  19. crazynoob11 Says:

    I made a program specifically for RGB, Hex, and binary translating. It also comes with a calculator incase you need to do any calculations. PM me if you’re interested in it. The RGB part converts a color into hex and in our number system too. You basically get a color panel and you can choose a color. Then my program does the rest of the work. This comment was made when I hit 2:43 of the vid by the way, when you started mentioning RGB.

  20. H3dQ Says:

    move the session_start(); to the top of the script

  21. TheGHURABAA Says:

    hey i tried the code, but it didnt work with me, i get this error in the HEADER LINE :

    Cannot modify header information – headers already sent by (output started at C:xampphtdocswelcomeimage.php:2)

  22. thierrydel1 Says:

    You have to make a form and to use the viariable get to add some text or directly to the script

  23. shanetalbert Says:

    cool it works, but how do you add other text to the page?

  24. SwiftNinjaChaos Says:

    Really good tutorial, got the point across (even though I knew how to do this already myself).

    One small problem however is that you can make this more accurate by using a function which comes with the GD library called imagefontwidth(font) which takes a font as a parameter (for example: 5) and returns the width of a single character in that font.

    So the $length variable can be set like so:
    $font_size = 5;
    $length = strlen($message) * imagefontwidth($font_size);

    Good video.

  25. evermanito Says:

    how can i make make a character maker?

Leave a Reply