Would you like to react to this message? Create an account in a few clicks or log in to continue.
Check out the Members Guide here!
New? Post an intro here!
Shops are located here!
Log in
Latest topics
Zane Has Arrived!Fri May 03, 2013 6:44 pmZaneTruesdale
Some Old and Some NewWed Jan 30, 2013 7:37 pmMalikai20
Freeman [collab]Wed Jan 30, 2013 7:15 pmMalikai20
H3R0 ROOM PRO Wed Jan 30, 2013 7:01 pmMalikai20
Malikai20...returning member new faceWed Jan 30, 2013 6:50 pmMalikai20
My Intro By Icy (dont call me something else)Tue Jan 08, 2013 12:59 pmicyeyes
Hi! My name is... A secretThu Dec 27, 2012 7:16 amfroflip
It's been fun :)Sat Sep 29, 2012 7:29 amH3R0_ELITE
Legendary.Thu Sep 20, 2012 3:40 amnoneednabs
Yusei the PuseiWed Sep 19, 2012 10:11 amH3R0_ELITE
MaaaD ShowcaseWed Sep 19, 2012 10:05 amH3R0_ELITE
Ultimate Duel Academy vs. United Nation AcademyWed Sep 19, 2012 9:31 amH3R0_ELITE
What up!!Mon Sep 10, 2012 1:07 amnoneednabs
Another game?Fri Sep 07, 2012 8:00 pmMinato
YO YO YO the king has arrivedFri Sep 07, 2012 12:45 amnoneednabs
Top posters
Minato (235)
235 Posts - 26%
Alex (211)
211 Posts - 23%
Spicer (103)
103 Posts - 11%
HenryXP (68)
68 Posts - 8%
LOKOS (57)
57 Posts - 6%
50 Posts - 6%
49 Posts - 5%
Nuran (49)
49 Posts - 5%
Vulpix (44)
44 Posts - 5%
Finly (40)
40 Posts - 4%
ChatBox

Go down
HenryXP
HenryXP
Slifer Red
Slifer Red
Posts : 68

How to make a .jpg from a .gif Empty How to make a .jpg from a .gif

Mon Jul 30, 2012 7:11 am
This is a simple hack to make JPG pictures move like GIF pictures. I dont know if it works or not but I did some research


The jpg image format has no provision for animation, however, with a little JavaScript and a dash of creativity, we can easily make an "animated" jpg.
You should keep in mind that the animated jpg is not one image but a series of images that are displayed in the same place in the browser.

We start by preloading all the jpg images required in the "animation".

The second step is to use a function that changes the source of an image. Finally, we call this function repeatedly by employing the setTimeout() method.
'Animated' Jpg'

var c = 1;

/* Preloading images */
var image1 = new Image();
image1.src = "a1.jpg";
var image2 = new Image();
image2.src = "a2.jpg";
var image3 = new Image();
image3.src = "a3.jpg";
var image4 = new Image();
image4.src = "a4.jpg";
var image5 = new Image();
image5.src = "a5.jpg";

function disp_img(w)
{
if (c == 6)
{
c = 1;
}
var img_src = "a" + c + ".jpg";
document.ani.src = img_src;
c++;
}
t = setInterval("disp_img©", 1000);

The entire script is placed inside the HTML document HEAD section.
We start by initializing a global variable c that serves as a counter and is also a part of the image name. After preloading the images (an1.jpg, an2.jpg, an3.jpg, an4.jpg and an5.jpg), we define a function disp_img() that changes the source of images named ani. The function also checks the value of variable c, assigning it a value of 1 if its value exceeds 5. The variable is also incremented each time the function is called. The function is called after every 1 second (1000 milliseconds) with the setInterval() method.

You can customize the script and create .jpg slide-shows easily.


(:SleepingMomo:)
(:SleepingMomo:)
Obelisk Blue
Obelisk Blue
Female Posts : 50
Age : 28
Location : Behind you O_o

How to make a .jpg from a .gif Empty Re: How to make a .jpg from a .gif

Mon Jul 30, 2012 7:44 am
Oh nice this might be useful to all our gfxers
avatar
Guest
Guest

How to make a .jpg from a .gif Empty Re: How to make a .jpg from a .gif

Mon Jul 30, 2012 7:52 am
I want to see an example of the end product please!
HenryXP
HenryXP
Slifer Red
Slifer Red
Posts : 68

How to make a .jpg from a .gif Empty Re: How to make a .jpg from a .gif

Mon Jul 30, 2012 4:47 pm
I'll try it if I get a chance if not ask Hero or another gfxer c:
Sponsored content

How to make a .jpg from a .gif Empty Re: How to make a .jpg from a .gif

Back to top
Permissions in this forum:
You cannot reply to topics in this forum