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 Pixeling > Converting PNG to chars
2024-09-24 00:13
Case

Registered: Aug 2002
Posts: 142
Converting PNG to chars

Hi,

I have a 1 x 2 font that I want to convert into a c64 format that I can use. Currently its a png format and when I loaded it into Charpad, it does convert it but it also removes duplicate characters and then makes a map of the character set layout where i just want it as a normal c64 charset.
2024-09-24 01:54
Raistlin

Registered: Mar 2007
Posts: 680
You could load into Pixcen I think, something like Unrestricted Hires, and then save the MAP file. That should be what you need?

Otherwise, send to me and I’ll send you a charset BIN back? I have tools I’ve made for C64GFX scraping that I made for this sort of thing :-)
2024-09-24 07:32
Jetboy

Registered: Jul 2006
Posts: 337
you can load it straight into kickass and process it there. can't recall propper syntax from the top of my head, sorry
2024-09-24 08:06
Burglar

Registered: Dec 2004
Posts: 1101
png2prg 1.8 supports all char-modes, but it doesn't do anything special for 1x2 or 2x2 character sets, so you'll have to do the reordering yourself.

I guess you want a charset ordered like this (for letters abc):
$01,$02,$03
$81,$82,$83
2024-09-24 08:11
The Syndrom

Registered: Aug 2005
Posts: 59
did you uncheck the "remove duplicate chars" option when importing the png into charpad ?
2024-09-24 08:19
Burglar

Registered: Dec 2004
Posts: 1101
oh, I didnt read, png2prg does allow "-no-pack", but this will only convert the first 256 chars in a png...

If you do not want charpacking, eg for a 1x1 charset, please use -no-pack.
2024-09-24 08:57
Raistlin

Registered: Mar 2007
Posts: 680
What Burglar says is right. For a typical 1x2 font, you probably want a PNG that is 512x16px .. so 64 chars across, 2 chars down.

That should convert in PNG2PRG (with the "no pack" option) to the form that you want .. so you have for example:-

A = $01 (top half), $41 (bottom half)
Z = $1a (top half), $5a (bottom half)
! = $21 (top half), $61 (bottom half)
0 = $30 (top half), $70 (bottom half)

etc.

That should give you a 1024 byte BIN file.
2024-09-24 09:13
Burglar

Registered: Dec 2004
Posts: 1101
Quoting Raistlin
What Burglar says is right. For a typical 1x2 font, you probably want a PNG that is 512x16px .. so 64 chars across, 2 chars down.

That should convert in PNG2PRG (with the "no pack" option) to the form that you want

actually, custom png sizes for chars is not (yet) supported by png2prg...
2024-09-24 11:26
Case

Registered: Aug 2002
Posts: 142
Quote: did you uncheck the "remove duplicate chars" option when importing the png into charpad ?

I wish, i cannot find any such option. Would have made this so much easier.
2024-09-24 11:41
Case

Registered: Aug 2002
Posts: 142
Quote: you can load it straight into kickass and process it there. can't recall propper syntax from the top of my head, sorry

That would be great, but unfortunately for this project I am using TASS64 because that was what it was started in.
2024-09-24 13:15
Mixer

Registered: Apr 2008
Posts: 452
Unless one of the proposed tools can do it, it takes just a few lines of Python code to do the conversion using PIL.
 
... 4 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
Andy/AEG
Unlock/Padua/Albion
Flavioweb/🇮🇹HF..
Peacemaker/CENSOR/Hi..
TheRyk/MYD!
Chesser/Blazon
B.A./QUANTUM
Visage/Lethargy
Alakran_64
Guests online: 110
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 Layers  (9.6)
2 No Listen  (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 Swappers
1 Derbyshire Ram  (10)
2 Jerry  (9.8)
3 Violator  (9.7)
4 Acidchild  (9.7)
5 Cash  (9.6)

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