Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Grabber Image Palettes

This thread is locked; no one can reply to it. rss feed Print
Grabber Image Palettes
ZoriaRPG
Member #16,714
July 2017
avatar

I'm looking at updating some stuff stored in a grabber datafile, where there are BMP and RLE images. What graphics programme can output files for the PALETTE used by the BMP and RLEs?

That is, what can still save 8bbp bitmaps with a palette that AG4 comprehends?

Peter Hull
Member #1,136
March 2001

IIRC you use the grabber to import the palette from a BMP or PCX; there's no 'palette file' per se.

ZoriaRPG
Member #16,714
July 2017
avatar

IIRC you use the grabber to import the palette from a BMP or PCX; there's no 'palette file' per se.

Aye. It grabs the palette from an image. That wasn't my issue: Grabber rejected all of the BMP files that I threw at it!

When I shifted to PCX in GIMP, it worked fine. (Grabber doesn't comprehend whatever 'Windows Bitmap' format that GIMP uses.)

Let me rephrase: What is a good, lightweight, and open-source programme that can output indexed PCX and BMP files in older formats? While PCX works fine, our userbase is pretty much used to PNG, BMP, JPEG, and GIF. The latter two, IMO, are a waste of time.

ZC outputs as PNG, which I'm pretty sure won't work, but I can check. I'd like to minimise the work needed by the end-user to generate a screenshot or similar in ZC, edit it, then output it in a file format that Grabber can read. (Possibly skipping the middle step.)

I'd like something that I can possibly include in a 'toolkit' for editing our .dat files for use with module generation. GIMP is far too big for that.

The splash screen for ZC is in one of the datafiles. Here's a quick example that I threw together, for the default.module datafile:

https://youtu.be/PGFjoN87o1E

(Is there an embed tag on the allegro.cc forum, for the youtube video format?)

I didn't do too good of a job on the bottom row of tiles, as I captured the wrong frames, but it's a placeholder until I can create better title screens in the future.

One thing that <i>I'm not sure about{/i>, is if the palettes handled on the code-side of things, or in the grabber itself.

Right now, we have one static title image that uses the same palette as our GUI. I was not around for adding that component, but I'd like to separate its palette into a second entry in the datafile.

I don't recall if there's a call to loadpalette() somewhere, before loading the image, or if the datafile itself somehow links the two. I'm pretty sure that it's the former, but it's be nice to have some verification before I waste countless time sorting through code looking for something that doesn't exist! :P

Anyway, I'm making fair progress, segregating the old, hardcoded assets into modular files, read in by a massive config file:

http://timelord.insomnia247.nl/zc-dev/2.55/modules/classic/classic.zmod

I'm eventually going to make a GUI to modify all of these strings (in Pascal, because it's far better at handling strings), and I'd like to make a similar tool for minor graphic editing, and datafile editing, as an update to Grabber, but specifically tilored toward ZC.

My goal is to make module credtion, and editing, as easy as possible. I'm eventually going to need to permit an encrypted module format, with a tool to encrypt them, but it'll be a dumb form of encryption, just for the sake of preventing userbase whining.

Audric
Member #907
January 2001

Note that you can compile the 'dat' utility, it shares a lot of code with the grabber and can be called from your own tools and scripts to access datafiles.

To draw or convert graphics to BMP (uncompressed ones), PCX, PNG and GIF, you can use Grafx2. It's 256-color only, so there's no risk of mixing 24bit images.

Peter Hull
Member #1,136
March 2001

The Windows .bmp file format has been updated to add new features, and as far as I can see, A4 doesn't support the newer headers. (https://github.com/liballeg/allegro5/blob/4.2/src/bmp.c)
I'm not 100% sure I know what you want (is this just for editing the title screens?) - you could use ImageMagick* to convert pretty much any file to a paletted bitmap.
If you need more careful control of palettes (e.g. convert multiple files to all use the same, shared palette) I don't think IM can do that, but you could write a custom converter. A good option for this could be (and you knew this was coming...) Allegro 5.

* certainly 'open-source', probably 'good', not really 'lightweight', but it is readily available.

Audric
Member #907
January 2001

If you need more careful control of palettes (e.g. convert multiple files to all use the same, shared palette) I don't think IM can do that

This surprised me, so I googled and little, and it seems so :/
There are less and less software that support indexed color images.

ZoriaRPG
Member #16,714
July 2017
avatar

Audric said:

Note that you can compile the 'dat' utility, it shares a lot of code with the grabber and can be called from your own tools and scripts to access datafiles.

To draw or convert graphics to BMP (uncompressed ones), PCX, PNG and GIF, you can use Grafx2. It's 256-color only, so there's no risk of mixing 24bit images.

Grafx2 looks viable. Thank you.

I'll also look over the other included tools for the DAT utility stuff.

Audric said:

There are less and less software that support indexed color images.

That's why I brought it up. The amount of software that properly supports indexed colour is a scant resource, and much of it is either too large/complex for an included tool; or isn't open-source (or lacks a compatible license).

A good option for this could be (and you knew this was coming...) Allegro 5.

Once 2.55 is done, I'm going to start working on 3.xx, using Allegro Legacy. That'll open up a few more doors in general, but for the present, my goals are to finish up the slated features without adding even more onto the pile.

A primary goal, is to divorce a lof of these old, hardcoded assets that contain non-free IP. That's why I've spent an unholy amount of time working on this facet; but at the same time, I want to ensure that 'Joe Average' (or realistically, Joe+), to be able to use the new format without needing to rely on tools that they can't actually run, or that have massive bugs; or need three tools to do one job.

IDK. It may end up needing three tools in the end.

Edit: Grafx2 does not support TarGA, so I may need to add that file type to the programme, for it to be viable. I'm not sure why it isn't supported!

Go to: