How to change the foreground color of animated GIF image using PHP???

Discussion in 'PHP' started by rahulephp, Jun 29, 2011.

  1. #1
    From last few days I am struggling to achieve this.

    For some reason, we need to change the Foreground (display) color of animated gif images without losing their animation.
    I am sure there should be some ways to do thing but i couldn't able to find that.
    A website ajaxload[dot]info is doing approximately same thing but I am not sure how they got this using PHP.

    Can anyone suggest the similar kind of PHP script to change the color of gif images??

    Thanks in advance
     
    rahulephp, Jun 29, 2011 IP
  2. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #2
    Its hard, but there is an option.

    Using imagemagick you can get all pictures from the image, use imagemagick to change the colors, save all images to disk and use imagemagick again to create the animation again.

    But its hard work :)
     
    EricBruggema, Jul 2, 2011 IP
  3. sarahk

    sarahk iTamer Staff

    Messages:
    28,899
    Likes Received:
    4,555
    Best Answers:
    123
    Trophy Points:
    665
    #3
    if it is one image you want to change and you only need to do it once then get yourself a graphics program that can handle animated gifs. Open the existing file and change the relevant image and recompile. Quicker, faster, cheaper. Time is money.
     
    sarahk, Aug 18, 2011 IP
  4. tiamak

    tiamak Active Member

    Messages:
    81
    Likes Received:
    2
    Best Answers:
    3
    Trophy Points:
    58
    #4
    true
    and when You modify animated gif with imagemagick then, hmm, to be honest it doesnt always work and look as expected.
    If You can compile own software on your hosting then it is better to use gifsicle (http://www.lcdf.org/gifsicle/)
    Gifs made with gifsicle look better and have smaller size than those made with imagemagick (this might be important if your animated gif is combined from many gifs).
     
    tiamak, Aug 18, 2011 IP