Extra - animating jpg

i lost alot of my time in this week trying to optimize GIF image inorder to have it less than 1 MB so i can put it in fabacademy cloud…

gif_opt imagemagik from hasan on Vimeo.

i ve this idea of posting jpg image and animating them in the browser,

this is script that can run thousands of single jpgs as gif - small size :)

animated jpg not efficient but legal…



var c = 1;
var tst_imgs =[];
function init()
{
 for (i = 0; i < 100; i++) 
    { 
        tst_imgs[i] = new Image();
        tst_imgs[i].src = "/2018/labs/fablabbahrain/students/hasan-jaafar/img/tst/m_00214-" + i + ".jpg";
    }
}
function disp_img(w)
   {
   if (c == 100)
   {
      c = 1;
   }
   var img_src = "/2018/labs/fablabbahrain/students/hasan-jaafar/img/tst/m_00214-" + c + ".jpg";
    document.getElementById("mylarge_gif").src = img_src; 
   c++;
   }
init();
t = setInterval("disp_img(c)", 40);


Resources:

http://www.imagemagick.org/Usage/transform/#fx_escapes http://www.imagemagick.org/Usage/anim_mods/#frame_mod https://www.w3schools.com/js/js_htmldom.asp

Related