Code Monkey home page Code Monkey logo

png2spd's Introduction

png2spd

A PNG image to C64 sprite converter

The python script converts a PNG image file into a SpritePad compatible binary file. It can be used to convert sprites for the Commodore 64.

Usage

png_to_spd(input_file, output_file, sprite_width, sprite_height)

input_file: name of the PNG image. Image must be (24X)(21*X) pixels

output_file: name of the sprite file (usually ends with .spd)

sprite_width: usually 24, which is the width of a hires C64 sprite

sprite_height: usually 21, which is the height of a hires C64 sprite

Example

spritesheet_to_spd("spritesheet.png","sprites.spd", 24, 21) loads a PNG file called spritesheet.png and exports it as sprites.spd in C64 SpritePad format.

Note: This script can easily be included into your make file, making it quite convenient to update sprites in an image editor (I use Asesprite) and save the bitmap file into the project folder of your C64 production. At compile time, the script takes the newest image file and converts it into a binary sprite file.

Dependencies

Uses Pillow image manipulation library

Version history

2020-05-25: initial release

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.