Adrien Destugues 428e1c36cf Some more optimizations to the color reduction algorithm. Now runs in a decent time on my laptop :)
There may be some more small optimisations possible in this area... i'm still thinking we could get a better palette by putting more priority on highly saturated clusters, but, as we don't store the saturation property in the clusters, it seems difficult to do. Probably it would require switching to HSL before doing the clustering, and finetune the multiplications done in Cluster_Split. Note: these modifications (and the one in the previous commit) will probably crash badly if using the reduction algorithm with a smaller precision than 24bpp. The program will try to do that if it is unable to malloc the big lookup tables (we need a table of 256^3 = 16Mbytes for the color lookup, and when loading we also have the 24b image in memory, and also the clustermap, and the occurence table, wich is 256^3*4=64Mbytes). So, either we assume every computer out there has 128Mb RAM, or I'll have to change my code back to use a lower precision if the malloc ever fails. Anyways, who's wanting to open files bigger than our marbles.pcx in grafx2 ? and who except me is running a computer without swap memory at all ?


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@374 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-09 16:40:36 +00:00
2008-10-08 19:40:47 +00:00
2008-11-29 00:49:06 +00:00
2008-10-12 19:09:29 +00:00
2008-10-08 19:40:47 +00:00
2008-10-08 19:40:47 +00:00
2007-04-14 20:18:30 +00:00
2008-11-28 23:50:28 +00:00
2008-11-28 23:50:28 +00:00
2008-11-29 00:49:06 +00:00
2008-11-28 23:50:28 +00:00
2008-11-28 23:50:28 +00:00
2008-11-28 23:50:28 +00:00
2008-11-28 23:50:28 +00:00
2008-11-28 23:50:28 +00:00
2008-10-08 19:40:47 +00:00
2008-10-08 19:40:47 +00:00
2008-10-08 19:40:47 +00:00
2008-10-08 19:40:47 +00:00
2008-10-08 19:40:47 +00:00
2008-11-29 00:49:06 +00:00
2008-11-29 00:49:06 +00:00
2008-11-02 20:33:36 +00:00
2008-11-28 23:50:28 +00:00
2008-11-28 23:50:28 +00:00
2008-11-28 23:50:28 +00:00
2008-10-08 19:40:47 +00:00
2008-10-08 19:40:47 +00:00
2008-10-08 19:40:47 +00:00
2008-11-29 00:49:06 +00:00
Description
Fork of grafX2: The ultimate 256 color painting program https://gitlab.com/GrafX2/grafX2
16 MiB
Languages
C 89.3%
Lua 6.9%
Makefile 1.6%
NSIS 1.1%
Objective-C 0.4%
Other 0.5%