| |
TWW
Registered: Jul 2009 Posts: 545 |
Kickassembler - Converting .PNG to Koala
Hey fellow hackers.
I wanted to write a converter in Kickassembler which can take any .PNG MC Bitmap screenshot from VICE (Then I don't need to worry about the RGB values since they are known) and convert into raw data you can use in your productions.
This is the way I imagine doing it:
#1 - Determin the background collor based on the most used collor in the picture
#2 - Verify there is no 4x8 block containing more than 3 collors+BG
#3 - Convert each 4x8 block afterwards and write the data into 3 lists (1 for BMP data, 1 for Charcollors and 1 for collmem).
#4 - Add BG collor at the end :-)
I'm looking for improvement comments on this or maybee I need to revise the way I think about this? |
|
| |
Skate
Registered: Jul 2003 Posts: 494 |
#1 can be a little problematic since graphician might have filled a larger area with a color other than the original bg color. so, if you detect another color as the background color, you might have problems at 2nd step even if color usage is legal. so, i think bg color should be entered manually instead of an autodetection system. autodetection can be optional if parameter is null etc.
rest of the process seems pretty fine to me. |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
"Determin the background collor based on the most used collor in the picture"
that does not work generically... you have to count how many colors are used in each 8x8 cell, and then from all 8x8 cells which use 4 colors pick a color that is used in all of these cells. |
| |
MagerValp
Registered: Dec 2001 Posts: 1078 |
If you already have the image in VICE, save out the bitmap and color ram instead of taking a screenshot...
|
| |
STE'86
Registered: Jul 2009 Posts: 274 |
Please follow Skates advice on the autodetect.
most common colour in a bitmap most certainly does not always mean its BG colour. in my stuff anyway.
Steve |
| |
Cruzer
Registered: Dec 2001 Posts: 1048 |
I vote for Groepaz's approach. |
| |
TWW
Registered: Jul 2009 Posts: 545 |
ok.
Find the common collor in all 4x8 blocks with 4 collors instead of #1.
gotit. thanx |
| |
The Human Code Machine
Registered: Sep 2005 Posts: 112 |
Groepaz's approach can also fail, if there are no blocks using 4 colors at the same time. For this I would make it optional to force the color by the user. Groepaz autodetection will always give the right picture, but not always the wanted background color. |
| |
algorithm
Registered: May 2002 Posts: 705 |
What magervalp said. No need for any conversion if the image is displayed in vice. Use the d021 color from there and save the data.
bank io
bsave "d800loc" 0 $d800 dbe7
bsave "inkpaploc" 0 $0400 $07e7 ;varies of course
bsave "gfx" 0 $2000 $3f3f ; varies of course
bsave "d021loc" 0 $d021 d021
|
| |
kmeg Account closed
Registered: Sep 2003 Posts: 5 |
If there is need for that I can update this tools The CCS64 Gfx Rippers to support Vice... |
| |
Cruzer
Registered: Dec 2001 Posts: 1048 |
Quote: What magervalp said. No need for any conversion if the image is displayed in vice. Use the d021 color from there and save the data.
bank io
bsave "d800loc" 0 $d800 dbe7
bsave "inkpaploc" 0 $0400 $07e7 ;varies of course
bsave "gfx" 0 $2000 $3f3f ; varies of course
bsave "d021loc" 0 $d021 d021
This is supposed to be easier than taking a screenshot? |
... 37 posts hidden. Click here to view all posts.... |
Previous - 1 | 2 | 3 | 4 | 5 - Next |