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 Coding > Kickassembler - Converting .PNG to Koala
2012-02-21 15:04
TWW

Registered: Jul 2009
Posts: 541
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?
2012-02-21 16:07
Skate

Registered: Jul 2003
Posts: 490
#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.
2012-02-21 18:26
chatGPZ

Registered: Dec 2001
Posts: 11114
"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.
2012-02-21 19:49
MagerValp

Registered: Dec 2001
Posts: 1055
If you already have the image in VICE, save out the bitmap and color ram instead of taking a screenshot...
2012-02-21 21:17
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
2012-02-21 23:16
Cruzer

Registered: Dec 2001
Posts: 1048
I vote for Groepaz's approach.
2012-02-22 01:00
TWW

Registered: Jul 2009
Posts: 541
ok.

Find the common collor in all 4x8 blocks with 4 collors instead of #1.

gotit. thanx
2012-02-22 08:17
The Human Code Machine

Registered: Sep 2005
Posts: 110
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.
2012-02-22 11:37
algorithm

Registered: May 2002
Posts: 702
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
2012-02-22 11:44
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...
2012-02-22 12:23
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
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
Acidchild/Padua
SAM
j0x
Rare Candy
Codey/Second Dimension
XXX/HOTLINE, TALENT,..
Honcho
Guests online: 132
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Memento Mori  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Wafer Demo  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Original Suppliers
1 Black Beard  (9.5)
2 Derbyshire Ram  (9.5)
3 hedning  (9.2)
4 Baracuda  (9.1)
5 Irata  (8.5)

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