fir
2024-10-29 08:27:19 UTC
[pc] means programming in c as some still dont know that programing in c
belongs to c and thus also could and should be discussed here
(it could also be discussed elsewhere but such grups are dead afaik)
i got the idea of image codec that compresses more than jotpeg if this
is possible..maybe not this what i consider but it is fun to consider anyway
the idea is to use maybe such recipe
image is a list of points something like
struct point {unsigned short x; unsigned short y; unsigned color; };
say
100, 100, 0xff0000
700, 300, 0xffff00
200, 700, 0xffffff
and you build the image that for each pixel in image (say 1000x1000
size) you find the closes (in a mean os sqrt(dx*dx+dy*dy)) point
on the list and set this pixel to the color of closest pixel
this will allow to store some images in an efficient way imo (Probably)
each point here has 64 bits/8 bytes of storage and to encode something
like polish flag image you need 2 points (16B)
i tested how it look if i set randomly soem dose of points like 1000
and render it and it looks like mosaic of random polygons mostly
pentagons though probably with dose of quads triangles and hexagons
now i think maybe to make simple editor to allow me to set thiose points
and drag them by mouse to see if some reasonal images can be build from
low dose of points
some notes
1) do you think it can be more efective storage than jotpeg?
2) the point size can be changed for examplesomethimes it could be cut
down if use les bits for x y and using liek palette for color
(also some other bit more elaborate modifications could be used)
3) most probably there could be also used one fiels
(liek say not this not much used alpha byte) for denoting how the
point could be treated - as points could work differently also
for example point could be marked not to chose closest
color but the mix making some gradient etc) - imo puting a variety
of meaning into thiose point potentially could make the best
optimisations for image
belongs to c and thus also could and should be discussed here
(it could also be discussed elsewhere but such grups are dead afaik)
i got the idea of image codec that compresses more than jotpeg if this
is possible..maybe not this what i consider but it is fun to consider anyway
the idea is to use maybe such recipe
image is a list of points something like
struct point {unsigned short x; unsigned short y; unsigned color; };
say
100, 100, 0xff0000
700, 300, 0xffff00
200, 700, 0xffffff
and you build the image that for each pixel in image (say 1000x1000
size) you find the closes (in a mean os sqrt(dx*dx+dy*dy)) point
on the list and set this pixel to the color of closest pixel
this will allow to store some images in an efficient way imo (Probably)
each point here has 64 bits/8 bytes of storage and to encode something
like polish flag image you need 2 points (16B)
i tested how it look if i set randomly soem dose of points like 1000
and render it and it looks like mosaic of random polygons mostly
pentagons though probably with dose of quads triangles and hexagons
now i think maybe to make simple editor to allow me to set thiose points
and drag them by mouse to see if some reasonal images can be build from
low dose of points
some notes
1) do you think it can be more efective storage than jotpeg?
2) the point size can be changed for examplesomethimes it could be cut
down if use les bits for x y and using liek palette for color
(also some other bit more elaborate modifications could be used)
3) most probably there could be also used one fiels
(liek say not this not much used alpha byte) for denoting how the
point could be treated - as points could work differently also
for example point could be marked not to chose closest
color but the mix making some gradient etc) - imo puting a variety
of meaning into thiose point potentially could make the best
optimisations for image