Computer Science Canada pic creator |
Author: | agnivohneb [ Sun Nov 11, 2007 3:02 pm ] |
Post subject: | pic creator |
This is just a quick program i made when i was bored. Pic Creator WARNING: This Program is still in the Beta stage and errors may occur. This program allows you to convert a .bmp or .jpg file to a turing readable .t file using the View.WhatDotColor (x, y) function. This is useful if you are creating a game (eg. mario) that uses moving pictures and you want to be able to compile it to an .exe file and send it to everyone but you don't want to have all of those picture files following allong. Why not just use this program and convert your pictures to a format turing recognizes and compile them with your program. All of your pictures are now in one .exe file. No need for a .zip folder! To use this program just copy your pic to the same dir as this program and enter the file name (don't forget the extension) into the program. It automatically will do the rest. and export it as a .t file. NOTE: Colour loss may occur. Only use small images. |
Author: | CodeMonkey2000 [ Sun Nov 11, 2007 4:33 pm ] |
Post subject: | RE:pic creator |
Wow that's pretty cool. Did you try using turing RGB.GetColour and RGB.SetColor functions? I think you get a better variety with that. |
Author: | agnivohneb [ Sun Nov 11, 2007 5:37 pm ] |
Post subject: | RE:pic creator |
Thanks I will try that and post a update |
Author: | agnivohneb [ Sun Nov 11, 2007 6:28 pm ] |
Post subject: | RE:pic creator |
Just tried and there is no difference. |
Author: | Nick [ Sun Nov 11, 2007 6:30 pm ] |
Post subject: | Re: pic creator |
agnivohneb @ Sun Nov 11, 2007 3:02 pm wrote: NOTE: Colour loss may occur.
wouldnt RGB prevent this? |
Author: | StealthArcher [ Mon Nov 12, 2007 7:23 pm ] |
Post subject: | Re: pic creator |
The functions you refer to only read turings default colors. |
Author: | SNIPERDUDE [ Mon Nov 12, 2007 8:32 pm ] |
Post subject: | Re: pic creator |
lol, I made a programme like this about a year ago. I kinda cheated though: I stored all of the RGB info in a text file (using a VB programme I made to get the RGB data, the turing whatdotcolour isn't that good), then made a corresponding turing program that converted the text file info into the pic. It works though... ![]() |
Author: | agnivohneb [ Tue Nov 13, 2007 6:24 pm ] |
Post subject: | Re: pic creator |
momop @ Sun Nov 11, 2007 6:30 pm wrote: agnivohneb @ Sun Nov 11, 2007 3:02 pm wrote: NOTE: Colour loss may occur.
wouldnt RGB prevent this? I did try but it stays the same colours and it was to confusing to get working. I just gave up and used turings default colours. |
Author: | agnivohneb [ Tue Nov 13, 2007 6:36 pm ] |
Post subject: | Re: pic creator |
Sorry to post 2 messages so quickly but I have uploaded the source and a new license (by-nc-sa). Please respect the license. Have a look at it and upload any changes. Beta projects should not have just one person working on them. |
Author: | StealthArcher [ Tue Nov 13, 2007 10:53 pm ] | ||
Post subject: | Re: pic creator | ||
You will get more help from me when yoiu change it to a gpl license.(Not meant to sound threatening or insulting, but it's hard to do with just text...) Anyhow, after seeing this, I decided to try and make my own, however, instead of creating another turing file, it creates a binary with your photo in it, all made with View.WhatDotColor, and it has 24bit bitmap quality. I'm serious, I can take any bitmap, turn it into a .tbm with this using whatdotcolor, and turn it back out with drawdot, and it has 24 bit quality. Now all i have to do is figure out a way to make it take less space than the original bitmap(though it does tkae less space than the .t files this makes). Any ideas on how to do so? It's still in mega rough format, so dont mind the obvious blights like global vars, and commenting lack.
|
Author: | StealthArcher [ Thu Nov 15, 2007 12:53 am ] |
Post subject: | Re: pic creator |
New version, posting on PSP. |
Author: | StealthArcher [ Thu Nov 15, 2007 5:54 pm ] |
Post subject: | RE:pic creator |
No matter what I seem to do I cannot cut down on size.... I've tried strings(dont ask...) And boolean as well now(why oh why can they not be 1 bit instead of one byte????) Reals, welll, im not really having the urge to try..... Any one have any ideas at all to cut down on filespace usage? |
Author: | Mazer [ Thu Nov 15, 2007 7:14 pm ] |
Post subject: | RE:pic creator |
Is a tbf image bigger than the respective bitmap image? |
Author: | StealthArcher [ Thu Nov 15, 2007 7:38 pm ] |
Post subject: | Re: pic creator |
Yes, that's why I'm looking for ways to cut down on filespace. If a boolean was a bit instead of a byte, I probably would just make it under the bitmaps original size. This is the boolean one. |
Author: | Mazer [ Thu Nov 15, 2007 9:30 pm ] |
Post subject: | RE:pic creator |
You generally don't write single bits. How many booleans are you using anyway? Can you not just store the RGB values? |
Author: | StealthArcher [ Thu Nov 15, 2007 9:38 pm ] |
Post subject: | Re: pic creator |
Thats just it. Storing each RGB value as a binary integer, makes the file almost 10x the size of the original bmp. Storing a pixels each rgb value as a modified integer, using 9 as a split, makes it only about 5% bigger, but converting a 300x300 photo takes almost 20 minutes. I attempted to use strings, a 100x100 photo wound up as a 30 mb tbm file...... So i thought about using boolean like basic binary, so as if first one is true then add 1 to r value and if the next 2 and then 4 and so on. But booleans are a byte each, not a bit, so I wound up with the same problem, of a ridiculous oversized file compared to the original bmp. I was thinking of reals and storing as many values as possible, but that as calculated, makes them too big AGAIN...... So, I'm out of ideas, and I'm asking you. |