An image reader that reads various image formats into BufferedImage objects.
GodPaint can now export BufferedImages.
Forward-compatibility improvements.  Java 14 cares about having an h1 before an h3, so switching to h1.  Not sure I like this, and might switch it to <b> or <em> or something like that instead.
Forward-compatibility improvements.  Bump JaCoCo so it works with Java 5 through Java 14.  Add a -source option for the JavaDoc plugin; if you are compiling with JDK 14, then set it to 1.7, and it'll ignore the module system.  Also set the version to 1.2.1-SNAPSHOT.

clone

read-only
https://hg.sr.ht/~adj/jimagereader
read/write
ssh://hg@hg.sr.ht/~adj/jimagereader

#JImageReader - Read Images into an AWT Image

JImageReader is a program that can read several image formats, and create AWT images for them, which can then be used in any AWT or Swing application.

There is also a companion project, ImageViewer (https://bitbucket.org/QuintillusCFC/imageviewer/src/default/), which allows basic image viewing as well as exporting to BMP, if your goal is to view images rather than work with them programatically.

JImageReader currently (September, 2019) supports Java 5 through 8. It may also work on Java 9 and later, but no specific testing beyond Java 8 has been done.

#Format Support

Full Support:

  • Microsoft Paint (MSP)
  • Sun Icon

Significant Support:

  • BMP, including most variants thereof (OS/2 2.x, Windows 2/3, Windows 4/5 without advanced features thereof, and RLE).
  • Truevision TARGA.
  • ZSoft PCX.

The Wiki has additional details on the nuances of format support, and there are integration tests to ensure formats supported in one version will be supported in the next as well.

#How to Use

There is SPI support for MSP, PCX, and TGA. This means that by building the project and adding it as a dependency in Maven, you should be able to simple write:

Image mspImage = ImageIO.read("helloWin.msp");

And as long as it is supported, the image will be read. SPI support for BMP has not yet been added.

You can also use any of the image readers manually. This involves:

#!java

TGAReader tgaReader = new TGAReader("truevison.tga");
tga.processFile();
BufferedImage b = tga.getImage();

After format support is clarified, and tests added for that, rounding out SPI support is the next priority.

#Project Direction

This is a hobby project, that can go a year or more between updates. However, the rough plan involves:

  • Adding tests and sample images to validate current format support and prevent regressions
  • Refactor some of the code for improved readability and maintainability.
  • Improve SPI support, including BMP SPI support and canRead validation.
  • Improved support for additional variants of current formats.
  • Adding support for new formats.

The format selection does not align with any particular metrics of usefulness, beyond perhaps what I might personally find useful. However, it is influenced by available documentation and sample images, and leans towards the obscure and unlikely-to-yet-be-supported-in-Java. Thus, if you have an obscure old format, and especially if you have sample images and documentation for the format, feel free to reach out.

#Project Versions

Version 1.1 is the current version, and adds improved BMP and Sun Icon support.

Version 1.2 is underway, and will add support for a couple Atari formats and SPI support for more formats.

All versions are available from the Downloads page (https://bitbucket.org/QuintillusCFC/jimagereader/downloads/).