Log In  

Would be useful to have an export option (in the console and in the command-line interface) to get the label image as a PNG, to print labels for physical carts or for emulation frontend metadata for example. Could be 'export game.label.png', using the same resolution as GIFs.

P#97250 2021-09-13 00:37

Now @merwok that would be nice. I 2nd this as I can definitely see a way of recalling and storing extra data in that method via console coding. Reading and recalling extra recorded data is always useful in programming.

Oh, and @zep, thanks so much for finally fixing the problem with the latest version of Pico-8 0.2.3 immediate mode inability to handle calling functions. You really are on top of it.

P#97257 2021-09-13 01:13

Little bump so that maybe zep sees this for 0.2.4c

P#109824 2022-04-07 10:00

@merwork This would be nice. If you want a workaround in the meantime, you can try my commandline tool
https://github.com/rtouk/picoknife

label command:

picoknife label {P8FILE} [OUTPUTFILE] [--scale N] [--transparent INDEX]
  [--alternate] [--palette COLORS] [--open] [--locate] [--verbose] [--silent]
  [--help]

    export label image from a .p8 file

    {required}
      P8FILE         input .p8 source file

    [optional]
      OUTPUTFILE     output image file
      -----------
      scale          upscaling factor (positive integer, such as 2)
      transparent    color index (0-15) to treat as transparent
      alternate      use PICO-8's alternate/secret color palette
      palette        use custom palette of (up to 16) comma-separated colors
      -----------
      open           open image file when finished
      locate         locate image file when finished
P#109888 2022-04-08 02:51

Fun that you made a tool! Some competition for picotool :)

However, there is no source code, and I don’t run untrusted binaries (especially not windows or mac binaries).

P#109904 2022-04-08 11:37
4

Hi @merwok
This is in for 0.2.4c, along with a matching import (which was requested somewhere else -- can't find it right now).

> EXPORT -L LABEL.PNG
-- DO SOMETHING TO IT IN AN EXTERNAL EDITOR
> IMPORT -L LABEL.PNG
P#109919 2022-04-08 17:26 ( Edited 2022-04-08 17:27)

:-D that's great, thanks!

is it also available as a command-line option for headless mode?

P#109954 2022-04-09 10:59

@zep Nice, it worked! Although I notice that black pixels are transparent. There could be an option to fill it with actual black, or it could be default if you assume most developers don't need a transparent label.

It's easy to fill manually though, so I'll do this for now.

P#125374 2023-02-05 20:29

Ah, I couldn't automate it even in non-headless pico8 -run mode, I get a syntax error:

Writing exactly the same code as in the cart, but in the live terminal prompt, works.

Quotes never work either way (in case file has space in name).

EDIT: found it! Whether running headless or via pico8 -run, non-interactive mode requires proper lua call. Therefore, you must use either the bracket call syntax or at least surround the single argument with quotes.

Since you need the option -l there is not a single argument, so you cannot use the quote trick (such as import "spritesheet.png"). So you must use the brackets, passing a string that contains the option and the argument, with a space between:

import metadata_label.png

becomes

import("-l metadata_label.png")

It's the same trick as when you do a complex export like export(title..".html" -i 30 -s 2 -c 14)

P#125375 2023-02-05 20:51

thanks for sharing your findings!

P#125737 2023-02-11 20:25

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-04-18 23:58:32 | 0.105s | Q:26