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....
 
2024-04-09 15:19
ThunderBlade

Registered: Jan 2002
Posts: 77
Can you add some info on what SPOT actually does to achieve its great results? Or is there a general article about C64 multicolor optimizing?
2024-04-09 21:34
Fungus

Registered: Sep 2002
Posts: 686
I don't know of any article, but my work flow is to remove unused bits and colors. Then sort most used colors into the color memory and then try to get the rest of the colors into the other map and then fill the unused with colors to create the longest runs I can.

It might be better to optimize for the longest bitpair runs, but I don't know how you would go about such a thing because of how the bitmap is laid out, perhaps that is what cjam is doing.

People often forget to and the color memory with #$0f.
2024-04-10 05:51
Sparta

Registered: Feb 2017
Posts: 49
Assuming that people typically use LZ-based compression (except CJam, of course), Koala optimization boils down to the bin packing problem. SPOT rearranges the colors using something that is probably best described as a best-fit-decreasing algorithm. I have a few more optimization steps but as it turns out they still need some fine tuning as they only work in select cases. E.g. I got Mermaid’s pic down to 5137 bytes with Dali but the other two got worse.
2024-04-10 11:53
Fungus

Registered: Sep 2002
Posts: 686
I suppose you could do some kind of statistical analysis of equal sequences over equal bytes of a given length and try to optimize for that. I would think repeating bytes of 8 would give better results than runs in the color map, if that's possible to do.
2024-04-29 01:39
Sparta

Registered: Feb 2017
Posts: 49
SPOT 1.3
 +--------------+--------------+
 | spot1.3+dali | spot1.2+dali |
 +--------------+--------------+
 |         7332 |         7349 | (Untitled/Floris)
 |         5136 |         5155 | (Song of the Sunset/Mermaid)
 |         5968 |         5986 | (Short Circuit/Karen Davies)
 +--------------+--------------+
2024-05-16 20:12
Burglar

Registered: Dec 2004
Posts: 1101
png2prg 1.7 dev version
+---------+--------+----------+------------+--------+
| spot1.3 | p2p1.7 | p2p1.7bf | p2p1.7best | p2p1.6 |
+---------+--------+----------+------------+--------+
|    7332 |   7373 |     7325 |         bf |   7546 | (Untitled/Floris)
|    5136 |   5246 |     5206 |       5194 |   5464 | (Song of the Sunset/Mermaid)
|    5968 |   5983 |     5988 |       5983 |   6155 | (Short Circuit/Karen Davies)
|    3618 |   3691 |     3591 |         bf |   3830 | (Portait L+D/Sander)
|    5094 |   5125 |     5109 |         bf |   5320 | (Weee/Mermaid)
|    7497 |   7505 |     7475 |         bf |   7612 | (Deadlock/Robin Levy)
|    8068 |   8130 |     8107 |       8087 |   8227 | (Room with a view/Veto)
+---------+--------+----------+------------+--------+
 - all resulting koalas are packed with dali
 - p2p1.7: default png2prg result w/o options
 - p2p1.7bf: -brute-force mode
 - p2p1.7best: hand-picked -bitpair-colors
 - p2p1.6: default png2prg 1.6 result w/o options

NB: the ones where I beat spot were hard to find ;)
2024-05-17 04:14
Sparta

Registered: Feb 2017
Posts: 49
Nice Burglar! :) I am looking forward to finding out more about your -brute-force mode (and the hand-picked -bitpair-colors).
2024-05-17 17:46
Burglar

Registered: Dec 2004
Posts: 1101
Quoting Sparta
Nice Burglar! :) I am looking forward to finding out more about your -brute-force mode (and the hand-picked -bitpair-colors).

cheers :) it's pretty simple:

- iterate over all combinations of the 8 most used colors
- use them as forced/preferred bitpair colors
- crunch with tscrunch
- sort by size

The hand-picking comes from tscrunch being optimized for speed, not size. dali will crunch some bpc combinations better than tscrunch crunches them, so shortest can mean some other combination for either cruncher.
In -verbose mode I print the 10 best combinations based on tscrunched size, so I just try a few of those.

bruteforce code is here: https://github.com/staD020/png2prg/blob/master/bruteforce.go
2024-07-13 12:41
Burglar

Registered: Dec 2004
Posts: 1101
I just released png2prg 1.8, now includes -brute-force mode to often beat SPOT 1.3 in pack ratio :)
+---------+--------+----------+------------+--------+
| spot1.3 | p2p1.8 | p2p1.8bf | p2p1.8best | p2p1.6 |
+---------+--------+----------+------------+--------+
|    7332 |   7372 |     7332 |       7324 |   7546 | Untitled/Floris
|    5136 |   5190 |     5149 |         bf |   5464 | Song of the Sunset/Mermaid
|    5968 |   5998 |     5963 |         bf |   6155 | Short Circuit/Karen Davies
|    3618 |   3647 |     3616 |       3589 |   3830 | Portrait L+D/Sander
|    5094 |   5080 |     5083 |       5078 |   5320 | Weee/Mermaid
|    7497 |   7471 |     7458 |         bf |   7612 | Deadlock/Robin Levy
|    8068 |   8097 |     8046 |       8038 |   8227 | Room with a view/Veto
|    7445 |   7490 |     7432 |         bf |   7582 | Vangelis/Talent
|    6759 |   6739 |     6737 |         bf |   6963 | Temple of Tears/Hend
|    7859 |   7848 |     7839 |       7821 |   7998 | Thanos/JonEgg
|    4859 |   4849 |     4782 |         bf |   4983 | Solar-Sonar/Leon
|    5640 |   5671 |     5613 |         bf |   5869 | Cisco Heat/Alan Grier
|    6243 |   6286 |     6228 |         bf |   6430 | Daylight/Sulevi
|    2850 |   2884 |     2848 |         bf |   3092 | Yie Ar Kung Fu/Steve Wahid
|    6727 |   6721 |     6730 |       6711 |   6901 | Lee/The Sarge
|    7837 |   7828 |     7798 |         bf |   7960 | Parrot/Mirage
|    4559 |   4536 |     4494 |         bf |   4821 | Dragon's Lair
|    4275 |   4324 |     4292 |       4284 |   4519 | Scorpion/SIR'88
|    5562 |   5558 |     5506 |         bf |   5668 | Hatching/Joe
+---------+--------+----------+------------+--------+
|  113328 | 113589 |   112946 |     112853 | 116940 | Total
+---------+--------+----------+------------+--------+

- all resulting koalas are packed with dali
- p2p1.8: default png2prg result w/o options
- p2p1.8bf: -brute-force mode
- p2p1.8best: hand-picked -bitpair-colors, or bruteforced with -npcc and/or -nbc flags
- p2p1.6: default png2prg 1.6 result w/o options
2024-07-14 23:26
Sparta

Registered: Feb 2017
Posts: 49
Nice improvements Burglar! :)

SPOT 1.4 WIP with the same 19 pics and dali: 112867 bytes

No brute force or hand picking ;)
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
kenji/dream
New Design/Excess
Jazzcat/Onslaught
rambo/Therapy/ Resou..
Darklord/Onslaught
Steffan/BOOM!
TFWP
Slammer/Camelot
Freeze/Blazon
Guests online: 101
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 Graphicians
1 Mirage  (9.8)
2 Archmage  (9.7)
3 Pal  (9.6)
4 Carrion  (9.6)
5 Sulevi  (9.6)

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