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 Pixeling > koala otpimizing
2007-03-08 02:41
Oswald

Registered: Apr 2002
Posts: 5094
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 ?:)
 
... 80 posts hidden. Click here to view all posts....
 
2007-03-12 13:41
WVL

Registered: Mar 2002
Posts: 902
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: 705
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: 1790
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: 705
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: 1409
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
2007-04-01 10:05
tlr

Registered: Sep 2003
Posts: 1790
Fine tuning is tricky to restrict. You compressor could just try a set of heuristics and choose the best one. Is that fine tuning?

Anyway, this got me interested! :)
Could you post the three source pictures you used so we don't work with different ripps?
2007-04-01 10:29
ChristopherJam

Registered: Aug 2004
Posts: 1409
Good point about the tuning - it's a fairly arbitrary restriction, and difficult to quantify. TBH I was also thinking it was time I downed tools and uploaded something, as I have other work I should be doing :)

Perhaps 'smallest executable that displays the three images in sequence, with space to advance from first to second and from second to third' should be the only rule.

Glad to see the interest, anyway! I've uploaded three PNGs and the common palette used as http://jaruth.com/c64/0704/srcs.tar.gz
but it may be simpler for you to just rip the data from the 3pics.prg. Bitmap is always displayed at $6000, with the video matrix at $5c00.

I just noticed that I failed to acquire the original shortcircuit loading screen - I vote we continue with the intro version at this point.

Where did WVL's contribution come from?

Happy coding!
Previous - 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 - 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
TFWP
Slammer/Camelot
Freeze/Blazon
New Design/Excess
Steffan/BOOM!
The Syndrom/TIA/Pret..
DuncanTwain
t0m3000/hf^boom!^ibx
DeMOSic/MS^LSD^ONS
The Human Co../Maste..
Didi/Laxity
Guests online: 109
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 No Listen  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Crackers
1 Mr. Z  (9.9)
2 Antitrack  (9.8)
3 OTD  (9.8)
4 Fungus  (9.8)
5 S!R  (9.8)

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