ForImage: A Fortran library for processing and editing PNM images and managing colors.
- PNM File Support
- Color Support
- fpm dependency
- How to run demos
- Projects Utilizing ForImage
- API documentation
- Contributing
- References
ForImage offers comprehensive support for PNM files, including creation, importing, and exporting capabilities. It seamlessly handles formats such as PBM, PGM, and PPM in both ASCII and binary representations.
Available features include:
- Original
- Negative
- Brighten
- Swap Channels
- Remove Channels
- Greyscale
- Rotate
- Flip Horizontal
- Flip Vertical
- Crop
- Resize
ForImage supports different color representations like RGB, CMYK, Decimal, Hexadecimal, HSV, HSL, XYZ, and color names. Users can easily set and retrieve color values, switch between color types, and find the closest matching colors.
If you want to use ForImage as a dependency in your own fpm project,
you can easily include it by adding the following line to your fpm.toml file:
[dependencies]
forimage = {git="https://github.com/gha3mi/forimage.git"}The demo_ppm program demonstrates various operations on PPM (Portable Pixmap) images. It generates Mandelbrot fractals, performs diverse manipulations, and exports images in the PPM format.
The demo_color program showcases manipulation of color spaces and their conversions. This program sets a custom color using various methods, converts it to different color spaces, retrieves color values, finds the nearest color, and prints color details.
To get started, follow these steps:
Clone the repository:
Clone the ForImage repository from GitHub using the following command:
git clone https://github.com/gha3mi/forimage.gitNavigate to the cloned directory:
cd forimageRun the demo_ppm example:
fpm run --example demo_ppmRun the demo_color example:
fpm run --example demo_colorcmake -B build -D BUILD_FORIMAGE_EXAMPLES=oncmake --build buildRun the demo_ppm example:
./build/example/demo_ppmRun the demo_color example:
./build/example/demo_colorNote: The executable must be run from the forimage directory.
| Compiler | macos | ubuntu | windows |
|---|---|---|---|
flang-new |
- | fpm ✅ cmake ✅ | fpm ❌ cmake ❌ |
gfortran |
fpm ✅ cmake ✅ | fpm ✅ cmake ✅ | fpm ✅ cmake ✅ |
ifx |
- | fpm ✅ cmake ✅ | fpm ✅ cmake ✅ |
lfortran |
fpm ❌ cmake ❌ | fpm ❌ cmake ❌ | fpm ❌ cmake ❌ |
nvfortran |
- | fpm ✅ cmake ✅ | - |
- ForColormap: A Fortran library for colormaps
- ForCAD: A Fortran library for Geometric Modeling using NURBS
If your project utilizes ForImage and you want to be added to this list, please add your project and create a pull request.
The most up-to-date API documentation for the master branch is available
here.
To generate the API documentation for ForImage using
ford run the following
command:
ford README.mdContributions to ForImage are welcome!
If you find any issues or would like to suggest improvements, please open an issue.