Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user Coinoperator ! (Registered 2024-06-17) You are not logged in - nap
CSDb User Forums


Forums > C64 Pixeling > koala otpimizing
2007-03-08 02:41
Oswald

Registered: Apr 2002
Posts: 5032
koala otpimizing

Hi Everyone,

I know there's a c64 tool out there that helps with optimizing koala pictures for packing, but no idea what it is called. Anyone knows?:) Timanthes would do the job for me aswell with its nibble swapper tool, but is there a way to load/save a native c64 koala format picture with it ? *.prg doesnt works, what format does it expect to be .prg anyway ?:)
 
... 68 posts hidden. Click here to view all posts....
 
2007-03-12 13:03
MagerValp

Registered: Dec 2001
Posts: 1060
Maybe it's time someone did arithmetic (de)coding on the 6502?
2007-03-12 13:15
Mace

Registered: May 2002
Posts: 1799
I always liked data (en)(de)coding, although it's not quite my field of expertice.

One of my experiments was plain Huffman encoding, but I quite when I had to find a way to store the binary 'tree' in such a way that the crunching actually produced a smaller file :)

Also, my knowledge of existing mathemetic algorithms is fairly non-existant. That's not handy, when doing stuff like this.

Just a brain fart: what experiments could you do with rotating data?
If you have data like:
.byte $00,$ff,$00,$ff,$00,$ff,$00,$ff,
Rotating that 90 degrees would result in 8 bytes with the same value.
Easier to pack than a pattern... sometimes :)
2007-03-12 13:41
WVL

Registered: Mar 2002
Posts: 887
another brainfart :

interleaving the bytes of the bitmap.

Instead of storing

byte 0,byte 1, byte 2, byte 3

you store

byte 0, byte 2, byte 1, byte 3, to try and undo the effect of pixelgrids.

Maybe shifting every odd byte 2 pixels would be even better.
2007-03-12 13:54
Mace

Registered: May 2002
Posts: 1799
Since we're having a farting party anyway, some other thought:

When looking at the colour bytes, you have 'only' 15*14*13 = 2730 (which happens to be $AAA) combinations. The 16th colour is the background and each colour will only occur once in the colour triplet (= 3 colour nybbles).
Unused colours can be optimized to match a triplet that is already in use.

The bitmap can be optimized to create the largest amount of equal triplets.

The triplets can be sorted to see how many combinations are really used. These can then be represented by the shortest combination of bits.

[edit, afterfart]
Ooh, another one!
You can know how many nybbles of the triplets are used, if you have the bitmap. So when the bitmap says 'only one nybble in use', you can use the other bits of the triplet to store info for the next position.
2007-03-12 18:46
algorithm

Registered: May 2002
Posts: 702
dynamic compression algorithms can be applied to specific areas of the bitmap. etc
2007-03-12 21:27
Mace

Registered: May 2002
Posts: 1799
Hey, this is not fair!
If Algorithm is in, I'm out!
He can't be beaten by us mortals when it comes to graphics encoding. ;-)
2007-03-12 21:30
Mace

Registered: May 2002
Posts: 1799
However, before we forget: the original question was how to optimize the content of a Koala picture for crunching.

This is still an interesting question.
2007-03-13 17:29
tlr

Registered: Sep 2003
Posts: 1732
Quote: However, before we forget: the original question was how to optimize the content of a Koala picture for crunching.

This is still an interesting question.


I completely missed that. :) I just read the later posts.
2007-03-13 23:33
algorithm

Registered: May 2002
Posts: 702
Its a whole new ball game if you wish to keep the file format intact. As mentioned before somewhere in this subject, swapping over color data between nybbles, etc or/and changing bit sequence order of twobit pixels so that there will be more identical sections - which in turn would allow a compressor such as exomizer to compress the data more tighter..

I still prefer the entire encoding of data and then custom compression - which would give tighter pack rates.. and its all about size..
2007-04-01 03:47
ChristopherJam

Registered: Aug 2004
Posts: 1382
I thought this 'otpimizing' sounded like an entertaining challenge, so I've given it a go.

No rules seem to have been particularly agreed upon, but the one I considered most entertaining was attempting to get all three images in the smallest executable file possible, vis my 19141 byte entry here:

http://jaruth.com/c64/0704/3pics.prg

It deinterleaves the colour data before using a simple run length compression scheme (the nybbles have been chosen to maximise the run lengths), then applies LZ77 with a fixed huffman code for the bitmap. The third image in the corpus is pixel shuffled to improve the packing. (saves over 200 bytes on the compressed data, but then spends 91 on the deshuffle code). I'm not familiar with Exomiser, but this does beat pucrunch for this particular data set.

FWIW, I got Song of the Sunset down to 5436 bytes - I could shave off another six or seven bytes if I hard coded some decompression parameters, but that would be in breach of ninjadrm's anti-finetuning rule. I didn't consider the optional pixel shuffle to be an issue, as whether or not to use it is specified in the compressed data, not the decoder (kind of like PNG's alternate pixel interleaves).

http://jaruth.com/c64/0704/song.prg
Previous - 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 - 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
Hok/Remember
Mibri/ATL^MSL^PRX
soci/Singular
polynomy
Dano/Padua
grass/LETHARGY
Guests online: 94
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 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Comaland 100%  (9.6)
9 Wonderland XIV  (9.6)
10 Aliens in Wonderland  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Replicate  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Rainbow Connection  (9.5)
7 It's More Fun to Com..  (9.5)
8 Dawnfall V1.1  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Birth of a Flower  (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 Original Suppliers
1 Black Beard  (9.7)
2 Derbyshire Ram  (9.5)
3 hedning  (9.2)
4 Baracuda  (9.1)
5 Jazzcat  (8.6)

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