Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user jmi ! (Registered 2024-09-15) You are not logged in - nap
CSDb User Forums


Forums > CSDb Entries > Release id #244202 : png2prg 1.8
2024-07-17 09:12
spider-j

Registered: Oct 2004
Posts: 482
Release id #244202 : png2prg 1.8

Awesome job again Burglar! Thanks!

But one thing for the "wishlist":
It would be nice if your console output would provide a "machine recognizable" line what the final output format is.

Somewhere (I think between 1.4 and 1.6) you changed the output so that my conversion script broke.

I like to keep all the "original" files (CharPad, SpritePad, SID, PNG) in a resources folder which get converted to C64 binaries as I need them to my sources folder. For PNG of course I want to use png2prg, but as it can output different formats I need a way to get the format for further treatment with dd etc.

This here i.e. worked in the past:
function getPng2PrgOutputFormat(array $output) : string
{
    $convLine = '';
    /*
     * find the line with the converted info
     * png2prg echoes a line like this:
     *
     * converted "INFILE" to "OUFILE" in "FORMAT" format
     *
     * step 1.)     look for a line starting with 'converted'
     */
    foreach ($output as $line)
    {
        if (substr($line, 0, 9) === 'converted')
        {
            $convLine = $line;
            break;
        }
    }

    /*
     * step 2.)     split the line on char " to array
     *              and return element '5' with the FORMAT
     */
    $convLineArr = explode('"', $convLine);
    if (!array_key_exists('5', $convLineArr)) return '';

    return trim($convLineArr['5']);
}


From what I can tell now there would be two lines to consider:
file "INFILE" has graphics mode: FORMAT/FINALFORMAT
falling back to FINALFORMAT because FORMAT for "INFILE" failed

This makes everything much more complicated.

EDIT: also having the output format in quotes was very good because it can contain a space :)
2024-07-17 18:17
Burglar

Registered: Dec 2004
Posts: 1066
Quoting spider-j
Awesome job again Burglar! Thanks!

But one thing for the "wishlist":
It would be nice if your console output would provide a "machine recognizable" line what the final output format is.

Cheers Spider!

This is actually solvable with the current version already, in 2 ways even:

1. Use the -sym flag
The -sym or -symbols flag makes png2prg write an output.sym file that looks like this for koala:
bitmap = $2000
screenram = $3f40
colorram = $4328
d020color = 0
d021color = 1
imho thats machine readable :)

2. Use -mode koala
When using -m <mode> or -mode <mode>, the gfxmode is forced and fallback is disabled.

And you are right, it did change between 1.4 and 1.6 to accommodate additional charset formats that cannot be distinguished by just counting colors per char.
Because I want default conversion to really do it's best to always provide a .prg, more fallback methods got introduced. For example when a pic looks like hires, I will first try ECM.

That said, I will add a final output line specifying the gfxmode. I think it's a good addition regardless.
2024-07-19 19:05
spider-j

Registered: Oct 2004
Posts: 482
Ah, thanks for the hint with -sym. That'll do the trick for now.

Option 2. is something I wanted to avoid, because I want to be able to just throw a bunch of PNGs that could contain anything into a dir and rely on your autodetection ;-)
2024-07-19 22:25
Burglar

Registered: Dec 2004
Posts: 1066
Quoting spider-j
Option 2. is something I wanted to avoid, because I want to be able to just throw a bunch of PNGs that could contain anything into a dir and rely on your autodetection ;-)

I actually already added the requested feature. You just need to build from current source.

It will print this:
write 8356 bytes to "q.prg" in "koala" format.
2024-07-20 07:36
spider-j

Registered: Oct 2004
Posts: 482
Awesome, that's perfect. Thank you! :-)
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
E$G/HF ⭐ 7
Sychamis
bugjam
Matt
Da Snake
megasoftargentina
alwyz/udi
tlr
Scooby/G★P/Light
MWR/Visdom
cobbpg
Jedfox/Exclusive ON
Guests online: 138
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Mojo  (9.6)
6 Uncensored  (9.6)
7 Wonderland XIV  (9.6)
8 Comaland 100%  (9.6)
9 No Bounds  (9.6)
10 Unboxed  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Party Elk 2  (9.6)
3 Cubic Dream  (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 Onscreen 5k  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Morph  (9.5)
Top Groups
1 Booze Design  (9.3)
2 Oxyron  (9.3)
3 Nostalgia  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.2)
Top Original Suppliers
1 Derbyshire Ram  (9.7)
2 Fungus  (9.3)
3 Black Beard  (9.2)
4 Baracuda  (9.2)
5 hedning  (9.2)

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