20i Reseller Hosting

Change background colour of Animated gif or MP4

Discussion in 'Website Design' started by Adam H, Apr 6, 2017.

  1. Adam H

    Adam H Well-Known Member Exclusive Member

    Joined:
    May 2014
    Posts:
    1,599
    Likes Received:
    217
    Used an online tool to turn the background colour from white to transparent which was fine for the gif, but then found that the gif was 800k in file size and not really small enough to use on a page, converting the same gif to an MP4 is great as it then reduces that further to 127k which is ideal for an animated web display.

    However on the MP4 the video background is natively white meaning it doesnt blend with the background like id want it to, Is there anyone that can change the background colour of the animated GIF or video for me ?
     
  2. Domain Forum

    Acorn Domains Elite Member

    Joined:
    1999
    Messages:
    Many
    Likes Received:
    Lots
    articles.co.uk
     
  3. dee

    dee Well-Known Member Acorn Supporter

    Joined:
    May 2013
    Posts:
    1,892
    Likes Received:
    217
    would this do it

    https://ezgif.com

    theres a colour filter on there and various tools
     
  4. Adam H

    Adam H Well-Known Member Exclusive Member

    Joined:
    May 2014
    Posts:
    1,599
    Likes Received:
    217
    Yeah thats the one I used to make the background transparent, unfortunately i cant see anyway of changing it to a different colour. Nor can I find any other working online tools which do it :(
     
  5. dee

    dee Well-Known Member Acorn Supporter

    Joined:
    May 2013
    Posts:
    1,892
    Likes Received:
    217
  6. Adam H

    Adam H Well-Known Member Exclusive Member

    Joined:
    May 2014
    Posts:
    1,599
    Likes Received:
    217
    Hmm , I tried that and it didnt work with my gif........but works fine with yours. Will try with a different browser just incase
     
  7. Adam H

    Adam H Well-Known Member Exclusive Member

    Joined:
    May 2014
    Posts:
    1,599
    Likes Received:
    217
    Na doesnt bloody work with my gif randomly.
     
  8. dee

    dee Well-Known Member Acorn Supporter

    Joined:
    May 2013
    Posts:
    1,892
    Likes Received:
    217
    Weird. That one was one they already had up there.
     
  9. Carlos Mexico

    Carlos Active Member

    Joined:
    Aug 2016
    Posts:
    66
    Likes Received:
    7
  10. Adam H

    Adam H Well-Known Member Exclusive Member

    Joined:
    May 2014
    Posts:
    1,599
    Likes Received:
    217
    Yeah it was originally a 1.7mb gif, the 800k is the compressed version :D
     
  11. Carlos Mexico

    Carlos Active Member

    Joined:
    Aug 2016
    Posts:
    66
    Likes Received:
    7
    Is the animation too long? How much time it takes?
    Maybe you can remove unnecessary frames or scale it to a smaller size.
     
  12. Adam H

    Adam H Well-Known Member Exclusive Member

    Joined:
    May 2014
    Posts:
    1,599
    Likes Received:
    217
    Its only a couple of seconds long but high in detail, I have tried to remove every second and 4th frames but it makes too much difference to the detail. The animation will never be small enough ( file size ) as a gif, hence the need to convert to MP4. The only problem is as a video the background, so the idea is to change the white background to the colour of choice ( slight off white/grey ) so that when we convert the gif to mp4 it also retains the correct colour background.

    Scale is also as small as we can make it without losing functionality 600px wide
     
  13. Skinner

    Skinner Well-Known Member

    Joined:
    Jul 2008
    Posts:
    4,658
    Likes Received:
    136
    I'm not sure you can simply change the background colour, you can set the transparency key to any of the 256 colour options but you can't enact a global colour change. Such a change would require it altering frame by frame, so a few seconds long could be as many as 60-100 frames, and be a heap of editing.

    Often changes like like are done with the source material before the animation is made, reversing from the gif is like reversing from a finished movie to make changes.

    Saying that, I've never tried, I believe photoshop has some basic gif editing options as does premier, I can take a look for you :)
     
    Last edited: Apr 8, 2017
  14. Adam H

    Adam H Well-Known Member Exclusive Member

    Joined:
    May 2014
    Posts:
    1,599
    Likes Received:
    217
    I think the way it would be done is rather than adding a layer ( background colour ) , it would be more of a colour replace. So all white in the gif would be replaced with a different colour...........which seems to be possible, just not with my gif lol
     
  15. Skinner

    Skinner Well-Known Member

    Joined:
    Jul 2008
    Posts:
    4,658
    Likes Received:
    136
    Depending on the imagery, a colour replace can go bad. The number of times I've simply replaced a colour only to find a bit of that colour is elsewhere on the image. Saying that a colour replace could work with such a limited colour palette.

    I'd probably use the flood fill too with zero tolerance so it only changes surrounding/touching pixels of the same colour, frame by frame.

    Its not something I've done before, so not sure how I would do it until I had it in front of me.
     
    • Like Like x 1