www.webdeveloper.com
Results 1 to 7 of 7

Thread: gd library

  1. #1
    Join Date
    Jan 2005
    Posts
    592

    gd library

    Hiya,

    general question.

    If I have an image or graphics can I change the color with the image? and if i can is it possible change like a blue gradient to red ect?

  2. #2
    Join Date
    Jan 2005
    Posts
    592
    anybody knows anything ? or maybe some tutorials ?

  3. #3
    Join Date
    Jan 2005
    Location
    Alicante (Spain)
    Posts
    7,739
    It's possible. Bested way would be to create a second image with the same dimensions and pallete size. Adding the hue could be done either by stepping through the image pixel by pixel with a double for loop, reading the source pixel and appling some logic to the values and then saving as the destination pixel, or you could add a semi-transparent mask with imagecopymerge() although there would be less control with that method.

  4. #4
    Join Date
    Jan 2005
    Posts
    592
    if the gradient would be only part of the image or grafic like an icon, would it be possible to change only the gradient color but leave the other colours the same?

  5. #5
    Join Date
    Jan 2005
    Location
    Alicante (Spain)
    Posts
    7,739

  6. #6
    Join Date
    Jan 2005
    Posts
    592
    cool I just had the idea.

    generate 2 different images. 1 the graphic without the color i want to change and the other one just the part of the graphic of which I want to change the color. After changing the color I simply merge them an save it and Bingo.


    Does that sound like its possible?

  7. #7
    Join Date
    Jan 2005
    Location
    Alicante (Spain)
    Posts
    7,739
    It is possible to lay an image with a transparent background over another image and maintain the transparent areas so the base image shows through. Look at this!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles