Welcome, Guest. Please login or register.


Author Topic: ConvPBX tool (Convert PaintBox images to PNG) (Read 9196 times)

Offline SlashNet

  • EP addict
  • *
  • Posts: 1346
  • Country: ua
  • Enterprise 128K | Cubietruck
    • My old site about Enterprise
ConvPBX tool (Convert PaintBox images to PNG)
« on: 2024.August.26. 18:29:24 »
Script for converting PaintBox files to png.
(I'm not very good programmer, so code some messy)

Requires Python 3 and PIL library.

Supports conversion of such video modes:

   2-col hires/lores
   4-col hires/lores
  16-col hires/lores
256-col hires/lores


Offline SlashNet

  • EP addict
  • *
  • Posts: 1346
  • Country: ua
  • Enterprise 128K | Cubietruck
    • My old site about Enterprise
Re: ConvPBX tool (Convert PaintBox images to PNG)
« Reply #1 on: 2024.August.26. 18:32:59 »
Have a question about attribute mode.

I can't fully understand sequence of storing pixel and colour bytes in PB files.
Also PaintBox has strange video modes (2col/4col/256col attributes). Are they same or have differences?

Offline geco

  • EP addict
  • *
  • Posts: 7219
  • Country: hu
    • Támogató Támogató
Re: ConvPBX tool (Convert PaintBox images to PNG)
« Reply #2 on: 2024.August.27. 10:46:47 »
I do not know structure of PB files, normally 1st half of the data is the attribute, and 2nd half is the bitmap, i can check if you send a attr PB file. But if you do not want to convert huge amount of files to PNG, then EP128emu screenshot works fine :D :D
I do not think that 4/16/256 colour attribute mode was ever used, those are totally useless, the resolution is decreased, but the number of available colours does not change, and used memory is also the same like in 2col attribute mode.

Offline SlashNet

  • EP addict
  • *
  • Posts: 1346
  • Country: ua
  • Enterprise 128K | Cubietruck
    • My old site about Enterprise
Re: ConvPBX tool (Convert PaintBox images to PNG)
« Reply #3 on: 2024.August.27. 12:56:33 »
I do not know structure of PB files, normally 1st half of the data is the attribute, and 2nd half is the bitmap,

As I see it's an ordinary vsave/vload file + 12 byte header.

Offline geco

  • EP addict
  • *
  • Posts: 7219
  • Country: hu
    • Támogató Támogató
Re: ConvPBX tool (Convert PaintBox images to PNG)
« Reply #4 on: 2024.August.27. 14:31:39 »
Normally there should be 8000 bytes attribute and 8000 bytes bitmap data after the header for a 320x200 image, the sequence can be the opposite.

Offline SlashNet

  • EP addict
  • *
  • Posts: 1346
  • Country: ua
  • Enterprise 128K | Cubietruck
    • My old site about Enterprise
Re: ConvPBX tool (Convert PaintBox images to PNG)
« Reply #5 on: 2024.September.05. 21:21:16 »
Normally there should be 8000 bytes attribute and 8000 bytes bitmap data after the header for a 320x200 image, the sequence can be the opposite.
In attribute files I see at 1st half 1-bit pixel data and 2nd half colour data. Thanks.

By the way, I made some modifications.
I studied other "formats" of uncompressed image files. And I realized that each program, although it uses the same format for storing graphic data, but the header, for some reason, each "invented" its own.
Having compared the possible options a little, I made an auto-detection (which seems not to even make mistakes :)  ).

But for VSave/VLoad files I don't know yet how to enter custom palettes (files don't store such information).

Code: [Select]
usage: ConvEPIC 0.3 [-h] [--zoom n] [--out filename.png] [--info] [--bias 0-31] [--format fmt] [--version] filename

Converting some Enterprise 128k image formats to png files

positional arguments:
  filename

options:
  -h, --help            show this help message and exit
  --zoom n, -z n        scale output image (default: 2)
                          0: don't stretch image horizontally
  --out filename.png, -o filename.png
                        output PNG image
  --info, -i            print header information
  --bias 0-31, -b 0-31  custom bias palette number
  --format fmt, -f fmt  input image format: (fmt=)
                            pbx: PaintBox image
                             fp: FinePen image
                            lor: Lorigraph image
                            spr: SprED sprite
                            zax: zAxial image
                          vsave: VSave/VLoad image
  --version             show program's version number and exit

2024 SlashNet