Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / NBI(non binary image format)

Author
Message
Three Score
20
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 20th Nov 2004 04:58
god i hope this goes as good as the last one(it got locked for a request for it to be moved)
ok this is pretty much copied and paste since i dont have a final about doc yet
http://free-space.myftp.org/nbi1-s.zip downlaod it there(has the core and basic paint)
and sorry for it being so unorganized

um the res doesnt matter
it is like the .raw format exept smaller and mor ecompressable

and the res is however high colors dbpro has and 800x600(until i update the core with A scroll bar)


it has no preset or limit to res u draw and the res is the highest and lowest x,y

I mean currently, it seems to have
loseless compression (WinZIP, or whatever your want)
I assume 32bit colour
This method you use assuming a pixel is "blank" unless otherwise specified could very easily be adapted to allow transparency couldn't it?


edit:
well i finalyl got it done btu made a special program for it that just amde a random image that used every pixel
and i almost wet my pants when i looked at it
2.8mb
561kb compressed in .zip
btu however this is with ever pixel being colored which things such as photos do but thinik of .raw some images of them are over 10mb
and this is with no artifacts or quality degrades

edit2:
so wut do u thnk higher or lower than u thought

got it converted now upgraded to 1.7a beta

nwo an example file would be

nbi ; a verifing thing to make sure this is nbi
1.7 ;version number to make sure interprter is not out of date
0 ;bgcolor red amount
0 ;bgolor green amount
0 ;bgcolor blue amount
1843834 ;pixel color data the rgb value
2 ;how many pixels you are coloring wiht this color(compression encouraged)
147 ;the x coordinate of the pixel
134 ;the y coordinate of the pixel
156 ;the x coordinate fo the second pixel
123 lthe y coordinate of the second pixel




here is how i want the format to look

nbi ;verify
2.0 ;version number
16835 ;rgb value for background
4 ;the max amount of digits in one pixel x,y(like the farthest this could go is 9999 ;x 9999 ;y
283934 ;rgb value for pixel
2
00150901 ;x and y saving room on carriage returns
00191023 ;x and y for naother pixel




and here is the orginal thread incase u wantg it a bti more organized

http://forum.thegamecreators.com/?m=forum_view&t=42810&b=11

http://free-space.myftp.org for free ftp
website hosting and e-mail 60mb for ftp/webste 70mb for e-mail
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 20th Nov 2004 05:13 Edited at: 20th Nov 2004 05:14
Uh WHAT? Image formats(only raster image formats I think..I can't remember) do NOT store X and Y positions of pixels. They only store pixel data. Think of it like this:

0,0,255,255,0,255,255,255,0

A 3x3 256 color bitmap, would display as:

0,0,255
255,0,255
255,255,0

If that helps you understand what I mean.

Good day to you

AKA teh great Pet Rat.
Peace sells...but who's buying??
Three Score
20
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 20th Nov 2004 05:18
this si my own format thank you
it is different from others and if i did it that way then i would have about 1mb of waste in a big image

http://free-space.myftp.org for free ftp
website hosting and e-mail 60mb for ftp/webste 70mb for e-mail
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 20th Nov 2004 05:19
Yeah I know its your own format. But to be honest its silly.

AKA teh great Pet Rat.
Peace sells...but who's buying??
bitJericho
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 20th Nov 2004 05:26
well, it's a great idea..

But to store them as strings?? Each character would take up a byte of information, rather than the entire number itself consuming a byte... for example..

255 (white) would take up 255 bits for 2, 5, and the second 5.

Rather than one byte for the entire 255..

I know the point is to make it readable, but the method itself is quite cosuming

[center]
Come write!
Yarr join LoGD, and defeat other coders!
Three Score
20
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 20th Nov 2004 05:28
the reason is so it is different and non binary btu also so it compresses better cause binary does nto compress as well

http://free-space.myftp.org for free ftp
website hosting and e-mail 60mb for ftp/webste 70mb for e-mail
Chris K
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 20th Nov 2004 05:30
Yeah but it's smaller to start off with!!
bitJericho
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 20th Nov 2004 05:31
well, the reason it compresses better is because it's using 3 times as much space for every number..

What I could assume it's doing is taking a value (255) that's written in ascii and converting it to it's binary counterpart..

I've not written a compression algorithm, so that could be blatently wrong, but the fact is not to see that it compresses by 500 percent, but instead test your image format size compressed against a compressed bmp, or jpg

[center]
Come write!
Yarr join LoGD, and defeat other coders!
bitJericho
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 20th Nov 2004 05:36 Edited at: 20th Nov 2004 05:45
what I mean is, if you're saving it as a string in a text file, the value 255 would take up three bytes.

In binary 255 takes up one byte.

Should you compress the ascii 255, it would compress by converting 3 bytes into 1 byte.

Compress the byte value 255 and it wouldn't compress at all. and the ascii value would be the *same* as the byte value..

So what you're doing is taking the image, when not compressed, you're making it three times larger on the hard disk than it needs to be, which would be the case if you're loading it into db, unless of course you're using a zip library to convert it straight into db.. but I doubt that..

It doesn't convert better than a bitmap, because if you saved like a bitmap using ascii values, it would be three times larger than it's bitmap counterpart.

But you're saving differently, so compressed it appears smaller than a compressed bitmap.

I'm saying, save it in binary format, it'll consume a lot less memory on the hard disk, and use a converter or something to see the data..

I dunno, I can see a goodness in this idea, but I'm surprised you're doing it for the wrong reasons^_^

Quote: "2 ;how many pixels you are coloring wiht this color(compression encouraged)
147 ;the x coordinate of the pixel
134 ;the y coordinate of the pixel
156 ;the x coordinate fo the second pixel
123 lthe y coordinate of the second pixel"


This is how I figured regular compression worked, so you've got the logic.. just get rid of the ascii strings

[center]
Come write!
Yarr join LoGD, and defeat other coders!
Three Score
20
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 20th Nov 2004 05:49
hum good point i will consider it but still i am faced with the main idol of the idea "a non binary format that isnt .txt" wut do i do just get a new name and idea and do a complete code rewrite

http://free-space.myftp.org for free ftp
website hosting and e-mail 60mb for ftp/webste 70mb for e-mail
Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 20th Nov 2004 05:54
Why not just store the width, seperator, height, seperator, and 3 bytes for each pixel. In fact, I'm going to make that right now...

P.S. Bitmap is good because it has a palete(or however you spell it)

Quote: "I've seen the word programming and I'm not sure what it means. Anybody please explain?"


Quote: "We shouldn't sacrifice the truth to preserve "balance"."
bitJericho
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 20th Nov 2004 05:59 Edited at: 20th Nov 2004 06:09
Quote: "Why not just store the width, seperator, height, seperator, and 3 bytes for each pixel. In fact, I'm going to make that right now..."


no, his idea is better, as it would be a far smaller file size for larger pictures...

What I would do, is allow the option to save out as an 'uncompressed readable format' or a 'compressed format' that just the same but stored as binary rather than string (ascii)

and then in the header determine what kind it is so your parser can read it depending on the format..

So your parser would end up being able to read both formats and switch the way it loads depending on the header.

here's a thought
NBIFF and BIFF ^_^

[center]
Come write!
Yarr join LoGD, and defeat other coders!
Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 20th Nov 2004 06:09
Does his use a color value and an array of coordinates?

Quote: "I've seen the word programming and I'm not sure what it means. Anybody please explain?"


Quote: "We shouldn't sacrifice the truth to preserve "balance"."
bitJericho
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 20th Nov 2004 06:14 Edited at: 20th Nov 2004 06:14
yep, in essence he's losing the color value for every coordinate that uses it, minus one..

So in one stomp he's using a pallette AND some simple compression

[center]
Come write!
Yarr join LoGD, and defeat other coders!
Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 20th Nov 2004 06:24
I thought it was a list of DBP colors.
...and that will increse the file size even in binary compression.
Each byte in binary can represent a number from 0-99, even though there are 255 letters. If you used up to 255, and number fragment greater than 255 wouldn't fit. The ammount of digits per byte can only be as high as the number of nines in the greatest number in the number of letters full of nines.
If he used 2 bytes for a 4-digit coordinate, it would make 4 bytes per pixel. And then, he still has the color and the end array lines, and headers. If he made a global pallet and then wrote numbers per pixel according to the pallet, it would be the bitmap format.

Quote: "I've seen the word programming and I'm not sure what it means. Anybody please explain?"


Quote: "We shouldn't sacrifice the truth to preserve "balance"."
Three Score
20
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 20th Nov 2004 06:28
um im starting to get confused

and it is NBIF not NBIFF and thta si some good ideas jerico
and ilya i dotn undertsnad how i would do that or even what u mean

http://free-space.myftp.org for free ftp
website hosting and e-mail 60mb for ftp/webste 70mb for e-mail
bitJericho
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 20th Nov 2004 06:35
a byte can hold 0 to 255..

The best idea I would think is to use an rgb color, white being 255,255,255
then you can use 3 bytes rather than a double..

Perhaps my math is off.. but doing either way should take up the same amount of memory, the only difference being storing the rgb data would be easier to read

[center]
Come write!
Yarr join LoGD, and defeat other coders!
Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 20th Nov 2004 06:42 Edited at: 20th Nov 2004 06:46
Quote: " a byte can hold 0 to 255.."

Yes, but it can only hold 2 real digits.

And my format is the exact same size as bmp.
EDIT: Yeah! Mine's less than bmp by 46 bytes.
Testing 404's....
Er... 404's is monocolor.

Quote: "I've seen the word programming and I'm not sure what it means. Anybody please explain?"


Quote: "We shouldn't sacrifice the truth to preserve "balance"."
bitJericho
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 20th Nov 2004 06:54
ilya.. I don't understand.. a byte can hold..

byte = 0
byte = and everything in between
byte = 255

R AS BYTE = 255
G AS BYTE = 255
B AS BYTE = 255
white

am I not right?

ahh.. it was integer, stores 4 bytes.. leaving 32 million colors available right?

[center]
Come write!
Yarr join LoGD, and defeat other coders!
Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 20th Nov 2004 07:03
What I mean is that if you store a number, each byte would be 0-99, and when you fuse all the bytes together, you get your number. You can't use the remaining numbers a byte can be bacause you couldn't fit any 3-digit number without decimals or negatives in it. The numbers 100-255 should be special charecters.

So isn't his format monochrome unless you want anmost doubled file sizes(for 2 colors)

Quote: "I've seen the word programming and I'm not sure what it means. Anybody please explain?"


Quote: "We shouldn't sacrifice the truth to preserve "balance"."
Three Score
20
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 20th Nov 2004 07:03
no the paint program is
that paint program is the most basic thing u will probably ever see

http://free-space.myftp.org for free ftp
website hosting and e-mail 60mb for ftp/webste 70mb for e-mail
Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 20th Nov 2004 07:05 Edited at: 20th Nov 2004 07:06
Ok, but if you had 256 colors on a 512x512 bitmap, the file size would be insane.

For example, what would the file size of the attached file be?

Quote: "I've seen the word programming and I'm not sure what it means. Anybody please explain?"


Quote: "We shouldn't sacrifice the truth to preserve "balance"."

Attachments

Login to view attachments
Three Score
20
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 20th Nov 2004 07:07
ok for random colors and considering each and every pixel has a different color for a 640x480 image(at 32 bit color with no drawbacks as pure as .raw) the tested file size so far is 2.8mb

http://free-space.myftp.org for free ftp
website hosting and e-mail 60mb for ftp/webste 70mb for e-mail
Three Score
20
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 20th Nov 2004 07:09 Edited at: 20th Nov 2004 07:10
god i know i will ammke a converter to compare all this
(thanbk you god for the point command)


sry for double post

http://free-space.myftp.org for free ftp
website hosting and e-mail 60mb for ftp/webste 70mb for e-mail
Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 20th Nov 2004 07:25 Edited at: 20th Nov 2004 07:59
Here's one that will highlight the diffrences in red(256 shades of it). A little slow though.



Quote: "I've seen the word programming and I'm not sure what it means. Anybody please explain?"


Quote: "We shouldn't sacrifice the truth to preserve "balance"."
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 20th Nov 2004 07:29
I really don't see the point in this considering trying to edit images in notepad is madness, complete madness je tell thee.

AKA teh great Pet Rat.
Peace sells...but who's buying??
Three Score
20
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 20th Nov 2004 07:43
i know but still

ok now wtf is wrong wiht this code



and yes i am using a valid image(it is .jpg)
it just does nothing it write 7.9mb in black pixels and the image dont seem to paste

http://free-space.myftp.org for free ftp
website hosting and e-mail 60mb for ftp/webste 70mb for e-mail
Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 20th Nov 2004 07:58
You might want to you sync on.
Why don't you use 2 for-loops(for x and y)?
Also, you should use memblocks or bitmaps.
You posted the image at 100,100 yet you start at 0,0.
Replace the obious with this: color=point(x+100,y+100)
Are you sure the jpg isn't pitch black?

Quote: "I've seen the word programming and I'm not sure what it means. Anybody please explain?"


Quote: "We shouldn't sacrifice the truth to preserve "balance"."
Three Score
20
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 20th Nov 2004 08:04
oops i was testing soemthign when i made that change and no its nto the bg is white

http://free-space.myftp.org for free ftp
website hosting and e-mail 60mb for ftp/webste 70mb for e-mail
Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 20th Nov 2004 08:24
Are you sure your reader can read the format?

Quote: "I've seen the word programming and I'm not sure what it means. Anybody please explain?"


Quote: "We shouldn't sacrifice the truth to preserve "balance"."
Three Score
20
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 20th Nov 2004 08:36
yes hwy wouldnt it be able to and shouldnt it if i paste the image shouldnt the image show up as it is reading the pix data

http://free-space.myftp.org for free ftp
website hosting and e-mail 60mb for ftp/webste 70mb for e-mail

Login to post a reply

Server time is: 2024-09-23 00:18:34
Your offset time is: 2024-09-23 00:18:34