Amiga IFF Support

Ciao Jan,

we spoke about creating a file i/o plugin to support Amiga IFF images. As you might recall, I attempted using Sander van der Burg’s libiff module but I had encountered incompatibility with the CRT library used by PureBasic and libiff, so couldn’t manage to actually bind the library to the plugin.

Yesterday I’ve come across a PureBasic implementation of the IFF format, a module called TinyIFF. So I’ve contacted the author of the module and he granted me permission to reuse his code for the plugin project.

Currently TinyIFF supports the following formats:

format color depth notes
FORM ILBM 2—256 colors
FORM ILBM EHB 64 colors
FORM ILBM HAM6 4096 colors
FORM ILBM SHAM 4096—9216 colors not yet implemented
FORM ILBM HAM8 262144—16777216 colors
FORM ILBM 24bits 16777216 colors
FORM PBM 8bits 2—256 colors
FORM PBM 24bits 16777216 colors experimental

The module is designed to read images, but adapting it to also save to the format shouldn’t be an issue.

Could you please point out which of the above formats are of interest for a plugin supporting Amiga IFF (it’s too long I haven’t worked with the Amiga and I can’t remember any of these formats anymore). From what I remember, the Amiga supported a variety of IFF formats, with custom file extensions, and the IFF internal names in the above table might be known by other names in practical use.

Also, which of the above are already supported by PMNG? I know tha PM supports Amiga IFF (.iff) and Deluxe Paint Image (.lbm), and my guess is that these might actually cover one or more of the above.

Support for 24bits in TinyIFF is still experimental, and placed in a separate module, but I’ve managed to successfuly load and display 24bit images from Amiga image collections.

The discovery of this IFF module could really help development in this direction, for it provides a solid foundation to build on (its author invested a good amount of energy in its implementation).

Ciao Tristano,

sounds great. PM supports:
FORM PBM 8bits 2—256 colors read
FORM PBM 8bits 256 colors write

FORM ILBM 2—256 colors read
FORM ILBM 256 colors write

But important to note is:
PM only supports “FORM ILBM” with multiple frames (IFF animation) for reading, not for saving at all.
For the Amiga the best thing would be plugins that support reading and writing of IFF 2-256 colors image and animations.
Just noticed that the plugin interface does not support options handling to e.g. gather information about the supported color depths. But this can be added easily. Will talk to you via email about this. I still owe you some answers :slight_smile:


Plugins Repositories Created

Ok, finally I’ve managed to setup two repositories for the PureBasic plugins:

The first one is for the Amiga IFF plugin, the other one for the PureBasic plugins boilerplates/templates.

Right now they are both in Alpha stage (and will remain so until they reach a first stable release, and all the upcoming changes to PMNG interface are implemented in a stable release).

PureBasic Boilerplate

The PureBasic file I/O boilerplate is still a draft for I didn’t get a chance to test all the DLL functions (but I did test most of the read function and they seem to work).

I’ll be soon publishing the source and binaries of the FAKE plugin I’ve created, which is a proof-of-concept plugin that simulates file I/O operations (only load, right now) and provides a log window where info about the interactions between PMNG and the plugin are logged in real time. Useful for exploring the file i/o interface and getting better insight about the functions called and the parameters involved.

I’ll try to create also a couple of other demo plugins to show how the boilerplate should be used.

I’d love some feedback on the boilerplate code (i.e. if it’s too complicate to use, if it might need more comments, etc.):

Amiga IFF plugin

Haven’t yet published any code. I need to start adapting Flype’s Module TinyIFF code to work with the DLL. The first step will be to focus on loading the IFF images; the image writing code will have to be added later for TinyIFF was designed as an image decoder, not an encoder.

But it’s a good starting point, and the availability of TinyIFF is going to save me a huge amount of time.

Ciao Jan,

Trouble Finding Sample Amiga IFF Images

I’m having trouble finding open source/freeware Amiga IFF image samples to include in the repository for testing. What I’d need is a sample image/animation for every Amiga IFF type that should be supported for reading operations, e.g. a 16 color image, a 32 color image, 256 colors, etc.

They don’t have to be cool images, they could just contains color bars/squares for every indexed color, I only need them to compare that the image shown in PMNG is identical to the original. Also, for testing purposes, I’d really need to know the format/specs of the various images.

I can preview Amiga IFF images in my file browser without problems, but I don’t have any applications that can write to Amiga IFF format. I’ve tried googling to find ready made images, or a Windows free tool that can write to (hte various) Amiga IFF, but it’s been consuming all the free time I’ve allocated to the project, without any useful results.

Unfortunately, I’ve only so many hours a week I can dedicate to the plugins project, and right now trying to find sample images is eating up most of that time, instead of working on the plugin code. Keep in mind that I don’t recall much of the Amiga world, too long has passed. Setting up an Amiga emulator with all the image editing tools would probably consume even more time for I’d have to read the documentation.

It might be a good idea if you could provide somewhere (in a GitHub repo, in the forum, or in a Zip file downloadable for Cosmigo website) a collection of sample images for all the formats that you’d like to see supported by user plugins, with a text document specifying the format and specs of the various images — an maybe having the file names indicating the spec too, eg:

  • ILBM_256col__120x120.IFF
  • ILBM_EHB_64col__120x120.IFF
  • etc.

This holds true not only for the Amiga IFF, but for any image/animation formats on the wishlist — eg. C64, Atari, whatever. With most of these retro image formats the problem is that finding free samples is not so easy (unless you have already setup emulators, etc.), and often a format has many variants using the same extensions.

For someone who has already set up an emulator, creating simple images (even just color bars) and saving them with different palette sizes should be rather simple.

I will write to some guys that could have files from past Amiga projects. If it’s not working then I’ll try to create some.