vendredi 16 septembre 2016

My image format to totally* avoid virus and malware free to all (OMG, I found out something as I write this)

*Because something like that

The point of this technologies is to offer to anybody a format of image that is secure. Test need to be done to see if it follow the performance of the other format.

Someone with a head or with a intelligence can read this post and program this in his image viewer program. Because of course, my format need a viewer program such as FastStone.

***

Note that I'm not aware of some things and I'm all alone. I have some question to ask to expert before be sure. These resolve question could lead to major bandwidth save on a network.

***

The image is a file.
The first 10 digit or input of the file is the horizontal resolution.
The next 10 input is the vertical one. So from 11 to 21.
If the resolution, both vertical and horizontal is less than 10 digit, it end with a A.

The 22th input is the first pixel color of the left top corner. Follow by a A for closing the command.
Or the number after the second A is the first pixel left top corner. Follow by a A for closing the command.

1920A1080A255A-second pixel here-A-and so on

So it start from the left top corner and goes like you read a book until it reach the last pixel define by the resolution.

Resolution 1920 X 1080 = 2 073 600

***

See how weird things is, I can't tell how much meg is 2 million of A.
It's quite obvious that for be performant, I need a compression scheme. And I know how. Next, stay tune.

2 gig without compression. omg.

***

Edit: So anyway, excuse me but it's because I found out something big while writing this. Now I will talk about my compression without lost. Yes because I got another one with lost too.

***

Let's take an example:

1920A1080A255A

Say there is the pixel with the color 255 1000 times in the image.

255 will be replace by 01.
And 255 will receive 01 in the database.
The database is sent with the image.

The viewer program will use the database and modify the 01 by 255 live or on disk with a decompression of the file and so a new file will be made uncompressed.

Now, my compressor will assign the smaller number starting by 0. 01 than 02 and so on. To the most replicated pixel of the same color.

Say 255 is 1000 times 
And 256 is 2000 times

255 get 02
and 256 get 01

And so on

So instead of 3 digit to define a pixel color, I got 2 digit. So I have save 3000 byte. One byte = 1 digit.

Things get interesting with color with a large number. Because my info say there is 65 000 color.

So as I write this, I'm not sure if this compression is worth it. The question is, how much pixel are usually the same in an image.

So my team need to test that and see.

I forgot to mention that a number need to be assign to a color. I'd use the photoshop pallete and numbers.

More(1a compression):

If the next pixel is the same and there is a lot of it the code will look like this than:

1920A1080A255AR4000A

R4000 mean same color as the previous one repeat 4000.

With this I must save byte for sure! Test now!

***

More: On a image with all the same color, the code will look like:

1920A1080A255ARRRR

RRRR mean repeat all.

So a 1080p image of the same color take 19 bytes.

***

Just for fun, I'll make the program to calcul how much pixel repeat.

Take an image

Take pixel one color number and if a pixel is the same + 1 on string a1. Put string a1 in log.log
Repeat to all pixel. Put string x on the line below.

So the final log.log will look like:

10 0000
200
400000
60
ect for 2 million of lines

Than I just need to add all this number and know how much byte I save for the image.

***

I have another compression method that could save space as much as A1 compression. It's diagonal on the matrix and line bellow/over.

***

So I figure out a little more with God how computer work. There is no marker and it's the end of a byte. Which have 8 digit in it.

So we just need to covert this:  1920A1080A255A-second pixel here-A-and so on
in binary and remove the marker A.

I'll maybe rewrite this someday when I'll have a team or some people interested. For now I stop there.




















Aucun commentaire:

Enregistrer un commentaire