
-----------------------------------
santabruzer
Thu Jan 29, 2004 10:56 pm

Bitmap to Turing
-----------------------------------
I'm just wondering, since a wacky idea came into my mind.. why not try to make a program that will take i dunnu, a jpg file, and draw it in turing, using dotdraw.. is that possible at all? if so, then it would be possible to create some kind of "illegal" module to implement GIFs.. and hence relieve some stress.. just i simply don't know how JPG, and BITMAPS are written in the code, and have no idea how you would go upon tackling such a challenge ...

-----------------------------------
Dan
Thu Jan 29, 2004 11:48 pm


-----------------------------------
i think some poleop have made stuff like that, check turing submisions i think i rember seeing one or two in there.

-----------------------------------
Tony
Fri Jan 30, 2004 12:36 am


-----------------------------------
the easiest way would be to just draw the picture on screen then use whatdotcolor :lol: to read pixels.

you can then save that information in a format of your choice so you dont have to load anything on screen in an actual program, just read the file.

.maf (Mazer's Animated Format :lol: I think he wanted to copyright that) for turing is actually quite possible. Just put a View.UpdateArea in a process :wink:

-----------------------------------
santabruzer
Fri Jan 30, 2004 7:18 am


-----------------------------------
well in all honesty i did tried to look and search under it, but i can't seem to find it in turing submissions.. if anyone else can find it easily tell me, and i'll look again.. plus if you find it, can you give me the keywords.. because so far, "Mazer's Animated Format" has come up empty..

-----------------------------------
shorthair
Fri Jan 30, 2004 9:10 am


-----------------------------------
Look for MAF , im sure ive seen him post about it with that ackronym

-----------------------------------
Tony
Fri Jan 30, 2004 9:22 am


-----------------------------------
heh, I think Mazer was just joking about .maf in that discussion of .gif copyright :?

I think the easiest way would be to keep frames in .jpg and have something like

procedure animate()
loop
     for i:1..10
     Pic.Draw(picID(i),x,y,picCopy)
     View.UpdateArea
     end for
end loop
end animate


-----------------------------------
Cervantes
Fri Jan 30, 2004 9:36 am


-----------------------------------
I did one of those before Turing4.0.5 without any View.UpdateArea...

the problem about these is its very unpracticle...  say you had a 200x200 picture, thats not that big...  you would have 40,000 lines of code!! for that ONE picture!!!!!!!!  its VERY unpracticle.

anyways here's mine:
var pic : int := Pic.FileNew ("Balloons.bmp") 
if pic = 0 then 
   put "Unable to load JPEG: ", Error.LastMsg 
   return 
end if 
Pic.Draw (pic, 0, 0, picCopy) 
var width : int := Pic.Width (pic) 
var height : int := Pic.Height (pic) 
var keep : array 1 .. width, 1 .. height of int 
for i : 1 .. width 
   for k : 1 .. height 
       keep (i, k) := View.WhatDotColour (i, k) 
   end for 
end for 
cls 
var count : int := 0 
for i : 1 .. width 
   for k : 1 .. height 

       var filenumber : int 
       var fn : string := "tob" 
       var one_entry : string := "Draw.Dot (" + intstr (i) + ", " + intstr (k) + ", " + intstr (keep (i, k)) + ")" 

       open : filenumber, fn, write, mod, seek 
       seek : filenumber, count 
       write : filenumber, one_entry 
       close : filenumber 
       var l : int := length (one_entry) 
       count := count + l + 2 
   end for 
end for

in this program just change the name "balloon.jpg" to whatever your pic is called. also the pic has to be in the same folder as the turing program.

Cheers

-----------------------------------
TheXploder
Fri Jan 30, 2004 10:52 am


-----------------------------------
I don't get why you would need GIF's a series of BMP's would work aswell, I made an example here:

-----------------------------------
Paul
Fri Jan 30, 2004 11:31 am


-----------------------------------
I dunno, can bmp's be animated on the net? I've only seen animated GIF's on the net.

-----------------------------------
shorthair
Fri Jan 30, 2004 11:48 am


-----------------------------------
I think thats the whole point , im not sure about the whole thing , but i think the point is that it only truly works for GIF's , im sure by now if it did work , peopel would be using jpg and bmp animators ,i but im probably wrong , im gonna go google the whole situation

-----------------------------------
Mazer
Fri Jan 30, 2004 11:54 am


-----------------------------------
The point is this:
JPG's and Bitmaps were never designed to be animated. To be used as frames in an animation, sure, but never to be a single animated file on their own. Bitmaps are just basic image files, and the whole purpose of the JPG is compression and quality. If you have a large image with a large range of colours, you could keep it as a bitmap and have no loss of quality, or compress as a JPG or GIF. As a JPG it would have good compression with little loss to quality, and as a GIF it would have great compression and crap quality. That's why GIF images are almost always used when there are very few colours. As for using GIF images for transparencies, that really sucks. There's a better version (PNG) for using transparency (in fact, it has true alpha transparency) but for some reason people who make browsers don't want to implement them properly.  :roll:

-----------------------------------
shorthair
Fri Jan 30, 2004 11:58 am


-----------------------------------
Thanks For Clearing that up mazer , i totally forgot about quality and Compression ,

-----------------------------------
santabruzer
Fri Jan 30, 2004 5:06 pm


-----------------------------------
now then.. thank you for all of your suggestions.. but i dunnu.. i just don't think i correctly stated what i wanted.. i don't need to create a file.. i want to open lets say the JPG compression, and save it as a JPG compression, as a true photo editor could do it.. all i wonder now, that i searched up JPG compressions and format on the internet, is if turing can handle reading and drawing the image by reading the file.. not using Pic.Draw..... and using drawdot after that information from the image was aquired.. now is that possible  :P

-----------------------------------
AsianSensation
Fri Jan 30, 2004 6:02 pm


-----------------------------------
didn't rizzix make something like that? A very good one too that could do many many things, I don't know where it is now, but try to find it, it was very very good.
