Answer the question
In order to leave comments, you need to log in
What is this compression method?
Hello everyone, I found a Mario game for the web, when I tried to change something, I couldn’t change the images, I found out that they are encrypted in a very strange way: https://github.com/planktonfun/mariophpjava-demo/b...
figured out the first part - these are colors from the palette, but what to do with x022,1111x010,x18,x07,x110 is not clear,
this is all parsed and brought to the form Uint8ClampedArray.
The question is how to work with this, because in fact this is a bitmap image encoded somehow?
How can I change the image into something convenient and then return to the form of numbers and x?
Answer the question
In order to leave comments, you need to log in
p[...] are the numbers of colors from the common palette, indices from 0 to 3.
Next come the dot colors themselves.
Digit 0..3 - color index in sprite palette
x - beginning of repetitions. Immediately after it comes the color index number, further to the comma - the number of repetitions (x011, - repeat 0 eleven times).
"p [0,2,5,8] x022,1111x010, x18 , x07, x110, x05, x17,33111000x18,32311000x19,3311003333x111,001133x110,001113x110,011213x110,011113x110,011113x110,0011233x15, x35,00222331133322200222203333002222" a
String of 256 characters
Split into 16 substrings
0000000000000000
0000001111000000
0000111111110000
0001111111111000
0011111113311100
0111111113231100
0111111111331100
3333111111111110
0113311111111110
0111311111111110
1121311111111110
1111311111111110
1111311111111110
0112331111133333
0022233113332220
0222203333002222
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question