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
2010-08-31 19:55
Mr. SID

Registered: Jan 2003
Posts: 424
You can do that with vicpack (http://code.google.com/p/vicpack/), but it saves sprites as a sequence of 63 bytes chunks, so you might need to add an empty byte after every sprite.

Alternatively, you will find that a Python script to do that particular job can be written in under 100 lines of code.
Having a script that does your conversion automatically means you can add it to your build process and changing the image file will automatically generate new sprites the next time you build your program.
2010-08-31 21:06
Shadow
Account closed

Registered: Apr 2002
Posts: 355
Perhaps you can make use of the built in graphics conversion routines of KickAss?
Look up getSinglecolorByte/getMulticolorByte in the Kick Assembler documentation.
2010-08-31 21:09
MagerValp

Registered: Dec 2001
Posts: 1060
If you're Python savvy I have a class for layered, tiled images with color restrictions. Doing a multicolor bitmap with a hires sprite overlay is as "simple" as:

Layer 0: 1 color, 1x1 pixels, 1x1 tiles, aspect 320x200 (i.e. d021)
Layer 1: 3 colors, 4x8 pixels, 40x25 tiles, aspect 2x1
Layer 2: 1 color, 24x21 pixels, 8x10 tiles, aspect 1x1

You can then control the palette for each tile, plot pixels, and read out bitmap data.

It needs a little more work to really be convenient to use, but it can handle pretty much any weird layered format you need...
2010-08-31 22:29
SIDWAVE
Account closed

Registered: Apr 2002
Posts: 2238
There is a C64 plugin for Photoshop.
2010-09-01 06:42
enthusi

Registered: May 2004
Posts: 675
gimp can export sprites.
Also there IS a python script available in codebase64.org

2010-09-01 08:39
Slammer

Registered: Feb 2004
Posts: 416
If your sprites is presents in a gif-file then do the following (The values in the list is the rgb values of the 4 sprite colors).

.pc = $3000 "Sprite Data"
spriteData:

	:LoadSpriteFromPicture("sprite1.gif")
	:LoadSpriteFromPicture("sprite2.gif")
	:LoadSpriteFromPicture("sprite3.gif")
// etc

.macro LoadSpriteFromPicture(filename) {
	.var picture = LoadPicture(filename, List().add($000000, $ffffff,$6c6c6c,$959595))
	.for (var y=0; y<21; y++)
		.for (var x=0; x<3; x++)
			.byte picture.getMulticolorByte(x,y) 
	.byte 0
}
2010-09-01 13:48
Skate

Registered: Jul 2003
Posts: 492
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?
 
... 6 posts hidden. Click here to view all posts....
 
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
Alakran_64
aZtOcKdOg
t0m3000/HF^BOOM!^IBX
Acidchild/Padua
Epyx
CA$H/TRiAD
Slaygon/Censor Design
Guests online: 52
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.7)
5 Edge of Disgrace  (9.7)
6 Comaland 100%  (9.6)
7 Uncensored  (9.6)
8 No Bounds  (9.6)
9 Wonderland XIV  (9.6)
10 Aliens in Wonderland  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Cubic Dream  (9.6)
3 Party Elk 2  (9.6)
4 Copper Booze  (9.6)
5 Rainbow Connection  (9.5)
6 It's More Fun to Com..  (9.5)
7 Dawnfall V1.1  (9.5)
8 Daah, Those Acid Pil..  (9.5)
9 Birth of a Flower  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Nostalgia  (9.4)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Offence  (9.3)
Top Logo Graphicians
1 Sander  (9.9)
2 Facet  (9.5)
3 Mermaid  (9.4)
4 Pal  (9.4)
5 Shine  (9.3)

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