I have started a binding to the GD graphics library here.
It currently supports only a tiny subset of the functions (mainly drawing primitives) included in this library
and will likely never be complete as it is purely a hobby project.
But as the GD library already exists for a long time, is easy to use and popular in
some fields), someone might still find it useful.
It is not the first Fortran language binding to the GD library, but the other approach I found here seems to be nearly 19 years old and not using iso_c_binding for the language binding.
Now I have added the pixel manipulation tools and very basic font support und basic support for copying areas of images.
Still missing (among others) is the support for Free Type fonts and more complex image manipulation tools (read and write).
Note that this library is not a real plotting tools but aims to be just a simple library binding for drawing things into pixel graphics (currently only *:JPG and *:PNG are supported) and read pixels from them.
The homepage of the binding now contains a list of already supported subroutines/functions.
Then five images of a flower: The “normally” colored one is the original, then there is color separation in the red, green and blue channels (done manually via pixel-wise manipulation), and the result of a built-in function for edge detection.
The code for the edge detection is really quite simple (sorry for my somewhat sloppy programmings style without error detection):
use iso_c_binding, only: c_ptr, c_int
type(c_ptr) :: im ! image pointer
type(c_ptr) :: output_image ! file pointer
integer(c_int) :: status
output_image =gd_fopen('outpics/flowers_edge.jpg'//c_null_char, 'wb'//c_null_char)
call gdImageJpeg(im, output_image, -1)
status = gd_fclose(output_image)
end program test_edge
gd_fopen and gf_fclose do not exist in libGD, but are just wrappers around fopen and fclose of the C standard library where I have added the prefix gd_ to avoid naming conflicts.
I will push the current version of the language bindings now, but not evertyhing is documented or tested yet.
I think the simplest way is to give them the basics of iso_c_binding: why they must append //c_null_char when they pass a string, why _c_int, what is c_double, c_ptr, etc. Expose that without assuming they should be familiar with C.