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.

The 20 Line Challenge / [LOCKED] basc paint program for my image format

Author
Message
Three Score
19
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 17th Nov 2004 10:12
here is a basic paint program for my non binary image format



if u dont have my NBI core(Non binary image format)
click on downlaod to get the source of it

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

Attachments

Login to view attachments
Emperor Baal
20
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 18th Nov 2004 03:28
Muahahah, non binary image format. Yeah right.. Your strings are binary boy

Anyway, good try

Three Score
19
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 18th Nov 2004 07:10
wut?
oh well i mean like well u know u cna open it up in notepad and see numbers instead of wierd characters plus u can make a image in notepad and a 190kb image compressed down to 14kb for me(in normal zip)

http://free-space.myftp.org for free ftp
website hosting and e-mail 60mb for ftp/webste 70mb for e-mail
Nicholas Thompson
19
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 18th Nov 2004 08:29
You say a 190Kb Image..
What is that? what res? What depth?

Just curious, but if this image format is so simple, why haven't a company done it yet?

Nick

Three Score
19
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 18th Nov 2004 09:20
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)

and i dont know why

http://free-space.myftp.org for free ftp
website hosting and e-mail 60mb for ftp/webste 70mb for e-mail
Nicholas Thompson
19
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 18th Nov 2004 11:01
Ok, the Res does matter!! Lol.. It determines how much data is required to be stored (Unless your format is vector not bitmap based?)

So - what resolution (size) images did you use to make your 190K image? I'm only asking so I can compare to PNG, GIF, JPEG and bitmap..

Three Score
19
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 18th Nov 2004 11:39 Edited at: 18th Nov 2004 11:40
um i really dont want to try to figure it out
i guess it is vector not bitmap then
it has no preset or limit to res u draw and the res is the highest and lowest x,y

(downlaod the file and oops it is 160kb oh well)

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

Attachments

Login to view attachments
Three Score
19
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 18th Nov 2004 11:41
i can make a converter from my format to jpeg or bmp and the like if u want to try to compare btu i cant make from jpeg to my format

http://free-space.myftp.org for free ftp
website hosting and e-mail 60mb for ftp/webste 70mb for e-mail
Nicholas Thompson
19
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 18th Nov 2004 11:49
Hmm.. interesting file format.

So are you saying it only records pixels that are SET? All the others is assumes are blank?

Its not a vector.. Vector is where you specify a start and end point and thickness, etc for a line. Bitmap is for pixel based images.

Three Score
19
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 18th Nov 2004 20:56 Edited at: 18th Nov 2004 20:59
um yea basically but u can set the background color

edit: well not in this paint program but there is a spot in the format where u say the background color

http://free-space.myftp.org for free ftp
website hosting and e-mail 60mb for ftp/webste 70mb for e-mail
Nicholas Thompson
19
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 18th Nov 2004 21:09
Right.. So it assumes the background is a certain colour and only records the non-background colours.. Sounds a little like PNG..

How big does a file come out that has every pixel set to non-standard at sat 320x200?

Three Score
19
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 19th Nov 2004 08:08
um probably a bit high
and do u mean each one a different color too

it would probably range from 600kb to 1.2mb but still be compressable to under 50kb in normal zip

http://free-space.myftp.org for free ftp
website hosting and e-mail 60mb for ftp/webste 70mb for e-mail
Nicholas Thompson
19
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 19th Nov 2004 09:09
You think? Could you try?

I'm just wondering why this format hasn't already been done.

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?

What do the numbers in the textfile represent?

Three Score
19
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 19th Nov 2004 09:21 Edited at: 19th Nov 2004 09:54
um i will eidt this post once i am done with the test cause it will take a while with that paint program and i iwlll amke a 640x480 image
with just one color but still add in about 100kb and u got colors


lemme get an exampel file and comment it

nbi ; a verifing thing to make sure this is nbi
1.6 ;version number to make sure interprter is not out of date
0 ;bgcolor red amount
0 ;bgolor green amount
0 ;bgcolor blue amount
255 ;pixel color data amount of red
255 ;pixel color data amount of greem
255 ;pixel color data amount of blue
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




so um i trully dont know why no one has thought this up ascii compresses so much better than binary also
who knows this could trully make me rich


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

edit3:
COULD A MOD/ADMIN PLEASE MOVE THIS TO GENERAL TALK OR DARKBAISC PROFESSIONAL DISCUSSION
(the reaosn is cause hardly anyone comes to this board i mena there are post from august on the front page)
Thanks

http://free-space.myftp.org for free ftp
website hosting and e-mail 60mb for ftp/webste 70mb for e-mail
Nicholas Thompson
19
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 19th Nov 2004 11:02
2.8Mb for a 640x480 image?! Thats quite high...

a completely uncompressed BMP at 640x480x24 has 3 bytes per pixel (24/8) and 640*480 pixels..
640*480*3 = 921600bytes
921600 / 1024 = 900kbytes

That zips down to about 136Kb.. This was a test file I knocked up in paint just spraying random colours for a minute.

You method will work well if there are only a few colours, not for photo's. Photo's tend to have completly unique colours.

Its a good idea, its basically pallete based then.

It sounds like you declare a colour and draw in all the pixels of that colour.

A suggestion that MAY or MAY NOT help..
When storing the pixel coords, try to do fixed width (declare at the start the width).. So say 3 digits for this example. Then put all the pixels on one line for that colour, eg:
001001512512087561
Are pixels:
1,1
515,512
87,561

Now, for that example, 5 bytes are wasted on excess zero's.. BUT you save 6 bytes from carrige returns (yes, evertime you press enter is costs 1byte, maybe 2.. I dont know if Carrige Return Line Feed is 1 or two bytes.. Think its 1).

This method could be furthered to say how many pixels you are colouring and how many digits for THAT set.. so if your only colouring a grouop in the double digit range, set it to two!

Just some thoughts.. Good idea tho!

Three Score
19
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 19th Nov 2004 11:16
that was my original idea i changed it because i have to read it as a string then convert it to a integer it gets pretty hard um and i got a new idea

how about instead of having
255
255
255
why nto just the actual color number although it will put more stress on the paint ti puts less stress on the core and file size
and hwo about like a little format chooser like u cna have nbifp for photos(although i would need to get something better which i ahve made somehtings thta increase size WITH a lot of colors but decrease it with a few

so i need some opinions and god how i wish i could just move this thread to the general or WIP board

http://free-space.myftp.org for free ftp
website hosting and e-mail 60mb for ftp/webste 70mb for e-mail
Nicholas Thompson
19
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 19th Nov 2004 11:25
Lol.. It'll be done by tommorrow.. Maybe email VanB or somoneone?

Three Score
19
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 19th Nov 2004 13:00
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

http://free-space.myftp.org for free ftp
website hosting and e-mail 60mb for ftp/webste 70mb for e-mail
Nicholas Thompson
19
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 19th Nov 2004 22:22
Is it any better?
My advice is, any time you make a change like this you should have a tester. Like a program that makes a file full of random pixels, then a blank one, then a few pixels of same colour, etc.. That way you can compare easier.
It shuold be better as before, say you had white.. It'd be 3 bytes + 1 for CRLF, times 3.. so 12 bytes to represent a colour. Now its no more than what.. 8?

Three Score
19
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 19th Nov 2004 23:52
um however high dbpro goes for color which i belive is 8 digits(or bytes)

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

http://free-space.myftp.org for free ftp
website hosting and e-mail 60mb for ftp/webste 70mb for e-mail
Jeku
Moderator
20
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 20th Nov 2004 04:31
Locked by request from author.


--[GameBasic - Coming Soon]-- ^^^ banner generously designed by TheBigBabou

Login to post a reply

Server time is: 2024-04-19 08:46:48
Your offset time is: 2024-04-19 08:46:48