image_io

v20240602

Output in BMP,PPM,QOI;input in BMP,GIF,JPG,PNG,PNM,QOI,TGA

Image_IO

Alire

Output in BMP, PPM, and QOI formats; input in BMP, GIF, JPG, PNG, PNM, QOI, and TGA formats

Package Image_IO.Operations provides the ability to input and output images.

Uncompressed BMP is a universal format and can easily be converted to compressed formats. PPM is intended to be a set of portable formats, but lacks support by default on some platforms. QOI is a lossless compressed format, but not widely supported.

Write_P3 uses PragmARC.Text_IO to obtain uniform line terminators across platforms. This can be easily changed to Ada.Text_IO if the line terminators are not a concern.

Read is a wrapper around Generic Image Decoder (GID) for the most common use: reading an image from a file. GID may be used to decode images from other sources, but that generality makes it complex to use. Read ignores transparency (Alpha channel) and only reads the first frame of an animation.

Pure_RGB is a demo program that reads an image using Read, modifies it to change all color components to the closest of 0 or 255, and outputs the result using Write_BMP. It is invoked with

 pure_rgb <name>

The output name is the input name with ".bmp" appended. Pure_RGB does no error handling; if the input file name is omitted, doesn't exist, or is not a supported image format, the program will terminate with an unhandled exception.

Image_IO and Pure_RGB have been compiled and tested with GNAT 12.3.0 on Linux and ObjectAda 10.5U7 on Windows.

Install

Globally install this crate:

alr install image_io

Add to your project:

alr with image_io

Crate Information

Authors

  1. Jeff Carter

Maintainers

Maintainers (GitHub pseudo)

Release Date

last year

First Release

7/18/2024

Statistics

Dependencies: 3

Dependents: 1

Versions: 3

Dependencies

gnat<13.0 | >=13.3
pragmarc^20240323.0.0
gid^13.0.0

Dependents