Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Converting animation into lossy charset - how ?
2015-07-12 12:14
Oswald

Registered: Apr 2002
Posts: 5031
Converting animation into lossy charset - how ?

I've always wondered how an algorithm decides how far is a char from another. any pointers ?
2015-07-12 13:36
MagerValp

Registered: Dec 2001
Posts: 1060
This should be a good starting point: http://stackoverflow.com/questions/613146/computing-the-differe..
2015-07-12 13:45
Krill

Registered: Apr 2002
Posts: 2856
You also might want to take a look at how JPEG compression works, which divides the image into 8x8 blocks prior to quantisation: http://www.fileformat.info/mirror/egff/ch09_06.htm.

The resulting image data is then represented in the frequency domain, and those coefficients you can compare and cluster rather easily and prioritise luminance differences over chrominance differences, as the eye is more perceptive to the former. Well, etc.pp. :)
2015-07-12 14:40
Oswald

Registered: Apr 2002
Posts: 5031
looks like quite a complex topic, FFT is a good idea, but I'd like to think there's a primitive c64 demo way :) fex what if each pixel checks how itself and its 8 neighbours differ from the pixels at the same position in the compared char.
2015-07-12 14:43
chatGPZ

Registered: Dec 2001
Posts: 11154
why dont you simply try it? with a simple compare function like you say its pretty easy to knock up afterall :)
2015-07-12 14:55
Krill

Registered: Apr 2002
Posts: 2856
Quoting Oswald
looks like quite a complex topic, FFT is a good idea, but I'd like to think there's a primitive c64 demo way :) fex what if each pixel checks how itself and its 8 neighbours differ from the pixels at the same position in the compared char.
We're talking about pre-processing here, and this has been on a far more complex level than the C-64 can manage for years now, for modern demos.
2015-07-12 15:25
Oswald

Registered: Apr 2002
Posts: 5031
I'm actually trying :)

Gunnar, yes I know, I'm just lazy to mess with FFT totally new territory for me, altho i know what its basically, but its a totally different thing when you have to code it (or make some alien code to work)
2015-07-12 15:37
Mixer

Registered: Apr 2008
Posts: 423
Very simple and very lossy system that makes very ugly pictures.

Make a random charset. Randomize it so that first char has 0 pixels set and last char has all pixels set. Second char has 1 random pixel set etc.

Count the set pixels in the char-area of the source image and replace the char with random char that has equal number of pixels set. This is like calculating the average luminocity over the char-area and matching it with charset.

One can go to many directions with this, for instance, the random charset generated don't need to be "linearly random". Also, once the image is matched to the noise charset, one can locate where each noise char is used and compare original image regions on those locations as more accurate 4x4 pixel luminosities, and alter the 8x8 noise charset quarters if a part of them is similar enough and iterate.
2015-07-12 16:06
Oswald

Registered: Apr 2002
Posts: 5031
macthing against char rom now, prototype fills the destination currently with 'N' :) more to debug..
2015-07-12 16:39
4mat

Registered: May 2010
Posts: 63
I think my petscii converter does a simple tally per 8x8 grid against the char rom, then picks the highest scoring char. Good thing is if you use a custom char set it'll always pick something regardless of the size. (in Party Bit the credit pictures were done with a 6 char font) Doing colour pics was a bit more involved, I went with a threshold level around the rgb values in the pic and compared against the palette's rgb. (Probably should have used luminance as well but I didn't)
2015-07-12 17:08
Krill

Registered: Apr 2002
Posts: 2856
Quoting 4mat
I think my petscii converter does a simple tally per 8x8 grid against the char rom, then picks the highest scoring char. Good thing is if you use a custom char set it'll always pick something regardless of the size.
Matching against an existing set of chars makes the problem a lot easier, i think. Generating an "optimal" set of arbitrary chars, on the other hand... :)
 
... 38 posts hidden. Click here to view all posts....
 
Previous - 1 | 2 | 3 | 4 | 5 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Flex/Artline Designs
t0m3000/HF^BOOM!^IBX
Bob/Censor Design
codise
hedning/G★P
psych
Guests online: 103
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.7)
5 Edge of Disgrace  (9.7)
6 Aliens in Wonderland  (9.6)
7 Comaland 100%  (9.6)
8 Uncensored  (9.6)
9 No Bounds  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Cubic Dream  (9.6)
3 Party Elk 2  (9.6)
4 Copper Booze  (9.6)
5 Rainbow Connection  (9.5)
6 It's More Fun to Com..  (9.5)
7 Dawnfall V1.1  (9.5)
8 Daah, Those Acid Pil..  (9.5)
9 Birth of a Flower  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Nostalgia  (9.4)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 SHAPE  (9.3)
Top Swappers
1 Derbyshire Ram  (10)
2 Jerry  (9.8)
3 Violator  (9.8)
4 Acidchild  (9.7)
5 Cash  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.05 sec.