Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jul 2003
    Location
    London
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Make img from other imgs specified in array

    Hi,

    I'm trying to make a script where:

    1) grabs info from a database - a number e.g. 001005001003004005

    001: Base colour
    first 005: Eye type and colour
    001: nose type
    003: mouth type
    004: hair type
    second 005: hair colour

    2) Check to see if the image "001005001003004005.ext" exists

    If it does exist, put it into an array.
    if it doesn't, create it!

    3) grab each corresponding image (each image has the exact same height and width)

    4) Lay the images on top of each other to make a new image and
    save as the file name as the one taken from the database.

    I did a search and someone said that gif's cannot be opened, but if they were in png format could I specify the transparent colour in each layer and re-save as a png (i'm positive they support transparencies)

    can anyone help?

    EDIT: BTW I have version 4.3.2 of php and have ImageMagick installed
    Last edited by thedevilspride; 09-19-2003 at 10:56 PM.

  • #2
    New Coder
    Join Date
    Sep 2003
    Posts
    98
    Thanks
    0
    Thanked 0 Times in 0 Posts
    GD Doesnt support png transparency but PNG does....

    use Imagecreatefromgif if you need transparent image :-)

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    577
    Thanks
    0
    Thanked 0 Times in 0 Posts
    gifs can be opened - just depends on the application used. Many stopped processing gifs due to unisys holding a patent on the LZW compression algorythm.

    afaik php4.3.2 has GD2.0.12 bundled and a nasty glitch in the imagecopymerge function (fixed in 4.3.3rc3 GD2.0.15). I did a colourizer a while back that layers images together (shown here) though seem to remember it fubars due to that glitch so wouldn't be any good. Uses pixel iteration and ignores background colour so doesn't need transparency.

    have never used imagemagick so cannot comment there.
    Last edited by Ökii; 09-19-2003 at 11:57 PM.
    Ökii - formerly pootergeist
    teckis - take your time and it'll save you time.

  • #4
    New Coder
    Join Date
    Jul 2003
    Location
    London
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Perfect!
    I really didn't expect it to work on my first attempt
    Thanks!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •