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 > Photoshop to Sprite conversion
2010-08-31 19:24
Trap

Registered: Jul 2010
Posts: 223
Photoshop to Sprite conversion

Hi all,

I am sure this has been asked before, but I haven't been lucky enough to find it. So, I dare ask it....

What's the easiest way to export some graphics from Adobe Photoshop (for example) to a multisprite arrangement that I can paste into KickAss source code. Now, Sprite-Editor 2.01 has some bmp/gif import capability and actually all the functions I need, but the program just doesn't work as intended. I haven't had any luck importing my graphics into it anyway.

So, anybody here who'd care to share the wealth and fill me in on a nice and clean way of achieving this?

Thanks a bunch.

/Trap
 
... 6 posts hidden. Click here to view all posts....
 
2010-09-01 13:48
Skate

Registered: Jul 2003
Posts: 494
here is what i do;

convert a 24x21 black/white image to grayscale and save in raw format. your file should contain 504 bytes containing $00 and $ff only. each byte represents a bit (7th, 6th, ...., 1th, 0th in order). use your favorite programming language to read these 504 bytes in order and group each 8 bytes in a single byte as bits. Here you have your 63 bytes of sprite data.
2010-09-01 16:28
SIDWAVE
Account closed

Registered: Apr 2002
Posts: 2238
I'm guessing, Congo 64 can do many things too.
2010-09-01 17:39
Trap

Registered: Jul 2010
Posts: 223
Wow. So many options ... I didn't realize there were so many.

I think I'll take a dive into the stuff that is already in KickAss.

Thank you everybody!!!

Trap
2010-09-01 17:40
Trap

Registered: Jul 2010
Posts: 223
Slammer, I wonder ... is there a way to do a bulk import in KickAss easily?
2010-09-01 19:48
Slammer

Registered: Feb 2004
Posts: 416
What is Bulk import? Please explain.
2010-09-01 21:13
Trap

Registered: Jul 2010
Posts: 223
I would like to import a big number of sprites. The code you show me requires me to split all sprites into one file for each sprite and then load each of them individually.
I was wondering if I could load a bigger file with all sprites in it at once.

Not sure I understand this bit by the way: "List().add($000000, $ffffff,$6c6c6c,$959595)" ... you say its the rgb values right? What do you mean exactly? Sorry for being dumb :|
2010-09-01 21:35
Slammer

Registered: Feb 2004
Posts: 416
The RGB (Red,Green,Blue) value is obtained in photoshop by selecting selecting the pipette tool and then clicking on a color. its 3 8 bit values that tells the intesity of red, green and blue - so $ff0000 is red, $00ff00 is green, $ffffff is white and $000000 is black.

To bulk load alot of sprites from a single picture just insert an extra loop in the macro.
2010-09-01 22:19
Cruzer

Registered: Dec 2001
Posts: 1048
Here's Slammer's example, adapted for bulk sprite loading, since I just did a similar script myself. It loads a pic with 8 sprites organized horizontally...

.var spriteData = $3000
.pc = spriteData "spriteData"
.var spritePic = LoadPicture("sprites.png", List().add($000000,$ffffff,$6c6c6c,$959595))
.for (var i=0; i<8; i++)
	:getSprite(spritePic, i)

.macro getSprite(spritePic, spriteNo) {
	.for (var y=0; y<21; y++)
		.for (var x=0; x<3; x++)
			.byte picture.getMulticolorByte(x + spriteNo * 3, y) 
	.byte 0
}

2010-09-01 22:40
Frantic

Registered: Mar 2003
Posts: 1648
I started a page on codebase related to Kick Assembler macros for various purposes. The two shown in this thread were added there. Feel mighty free to add more, and other kinds, of Kick Assembler macros to that page:

http://codebase64.org/doku.php?id=base:kick_assembler_macros
2010-09-02 08:28
Trap

Registered: Jul 2010
Posts: 223
Nice! Great to see the 8-bit is alive and healthy!

Thanks everybody!
Previous - 1 | 2 - 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
Act-Otl/Outlaws
zscs
rexbeng
Paulko64
Guests online: 94
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 No Listen  (9.6)
2 Layers  (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 Musicians
1 Rob Hubbard  (9.7)
2 Mutetus  (9.7)
3 Jeroen Tel  (9.7)
4 Linus  (9.6)
5 Stinsen  (9.6)

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