AcademySoftwareFoundation / OpenImageIO

Reading, writing, and processing images in a wide variety of file formats, using a format-agnostic API, aimed at VFX applications.
https://openimageio.readthedocs.org
Apache License 2.0
1.98k stars 597 forks source link

[FEATURE REQUEST]Add PCX support. #2917

Open DougRogers opened 3 years ago

DougRogers commented 3 years ago

This is an older format, but it would be nice to support for the sake of completeness. I still have these files on my harddisk.

CELTIC.zip

https://en.wikipedia.org/wiki/PCX

https://github.com/trapd00r/uberpaint/blob/master/src/fileio/pcx/pcx.c

lgritz commented 3 years ago

I don't have time to look into this, since it's a rare format that nobody will encounter in our primary user population and I don't recall any previous requests for it. But as Doug points out, some people will find it handy to be able to read those files and potentially convert them to a modern format. So I'll just leave this issue open in parking. It's a great self-contained project for somebody who wants to chew on something that will probably take a few days of effort and learn the ins and outs of implementing an ImageInput, but doesn't require prior knowledge of the rest of the code base.

The pcx.c code above linked above is not a license that can incorporated into this code base, but it's probably not hard to write a PCX reader from scratch, or maybe other working code can be found that has a compatible license.

DougRogers commented 3 years ago

Add .ras format to the list :)

lgritz commented 3 years ago

Hey, at least we already have support for .sgi files! You never know when IRIX will come back into vogue.

DougRogers commented 3 years ago

This one is MIT licensed.

https://github.com/gametutorials/tutorials/blob/master/Win32/Loading%20PCX%20Files/bitmap_class.cpp

DougRogers commented 3 years ago

Based on this:

https://github.com/gametutorials/tutorials/blob/master/Win32/Loading%20PCX%20Files/bitmap_class.cpp

Here is an OS agnostic version that loads a PCX file into a QImage. This is 99% of what you would need to create a plugin.

PCX.zip