Bevel and Emboss using GD graphics

Discussion in 'PHP' started by guruguy, Nov 8, 2008.

  1. #1
    Hi,

    Is there a way to bevel and emboss text using the GD graphics library? I want to be able to write a string out to an image, and give a shadow and bevel the text. Should the GD library be able to do this and how so, or should I move onto something like Image Magick?

    I have tried a quick google search although no results have been revealed, so some help would be much appreciated
     
    guruguy, Nov 8, 2008 IP
  2. xrvel

    xrvel Notable Member

    Messages:
    918
    Likes Received:
    30
    Best Answers:
    2
    Trophy Points:
    225
    #2
    I do not know if there is a built in library for this, but i usually use this trick.

    For example you draw the letter "A" on x = 100, y = 100, font size is 15px, with bright red color (255, 0, 0).

    Try to draw the second "A" as the dummy "embass effect" on x = 103, y = 103, font size 12px, and slightly darker (or lighter) red (150, 0, 0).

    You only need to make a duplicate letter with modified coordinate, font size, and color :)
     
    xrvel, Nov 9, 2008 IP
  3. guruguy

    guruguy Active Member

    Messages:
    553
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    60
    #3
    Thanks for the idea. I understand what you are saying but I am in need of a built in shading mechanism. I tried asking on another forum however I was told that there is no such tool, so I have decided to try out the PECL package called imagick, it should come in handy.
     
    guruguy, Nov 9, 2008 IP