Using FORTRAN to make pictures!

I was using FORTRAN in 1966 at Equitable Life. I then used FORTRAN to make pictures in 1989. Do others use FORTRAN to make pictures and which FORTRAN do they use and which graphics program do they use to draw to the screen? I used Compaq-Digital FORTRAN and Absoft grapics package. I would like to update. I am 81.

7 Likes

This is a program I wrote to make color charts.

  USE DFLIB
  INTEGER(2)       status, newx, newy, maxx, maxy,iii,jjj
  integer(2)       i,j,k,jj,kk,i1
  INTEGER(4)       ncolor,dummy 
  TYPE (xycoord)   xy
  COMMON           maxx, maxy
  do i1=1,6
  do i=1,256
  jj=0
  do j=8,256,16
  kk=0
  jj=jj+1
  do k=8,256,16
  kk=kk+1
  ncolor=(i-1)+256*j+256*256*k
  IF(I1.EQ.2) ncolor=(i-1)*256+j*256*256+k
  If(I1.eq.3) ncolor=(i-1)*256*256+j+k*256
  If(i1.eq.4) ncolor=(i-1)+k*256+j*256*256
  if(i1.eq.5) ncolor=(i-1)*256+k*256*256+j
  If(i1.eq.6) ncolor=(i-1)*256*256+j*256+k
  status=setcolorrgb(ncolor)
  iii=(i-1)*4
  jjj=((jj-1)*16+(kk-1))*6
  status = RECTANGLE( $Gfillinterior, INT2(jjj), INT2(iii), INT2(jjj+5), INT2(iii+3))
  End DO
  end do
  end do
  if(i1.eq.1) dummy = SAVEIMAGE("earlee.bmp",INT4(0),INT4(0),INT4(1599),INT4(1199))
  end do
  END
2 Likes

I use Dislin.

Welcome Earl to the Fortran Discourse!

Thanks to have accepted our invitation following that recent post about your work:

It is quite exciting to have here someone not only using Fortran for long but also for artistic purposes!

3 Likes

I have myself used a lot Digital / Compaq Visual Fortran to draw scientific results (propagation of light in waveguides), then started working on the gtk-fortran library. Many people here use various graphical libraries to draw or plot. See those two lists:

And several of us develop and maintain their own graphical libraries. For example, two days ago @Ali posted this:

See also: Binding to the GD graphics library and GitHub - gha3mi/forimage: ForImage - A Fortran library for processing and editing PNM images and managing colors.

I am an amateur of graphism, and have played especially with Peter Saville’s work:

1 Like

I was thinking about your needs. The easiest and most natural update for you would probably be to use Intel compilers. Visual Fortran was owned by many companies, and now it is Intel:
https://www.intel.com/content/www/us/en/developer/tools/oneapi/fortran-compiler.html
Installing the latest Intel Fortran compiler for Windows will let you access the QuickWin library. I think you would have essentially to replace in your code USE DFLIB by USE IFQWIN. You can see for example that setcolorgb() is supported:
https://www.intel.com/content/www/us/en/docs/fortran-compiler/developer-guide-reference/2024-1/setcolorrgb.html

Then you would be free to continue to code as you do (Compaq was Fortran 95), or to try more recent Fortran features introduced by the standards Fortran 2003, 2008, 2018 and now 2023.

I am not very competent with Windows, but many people here could help you installing Intel Fortran and associated tools.

Concerning “Absoft graphics package”, I am not familiar with it and don’t know what you did with it. But probably some people here can help.

We have an old plotting program that uses something called AGLib, which I don’t know the origin of. Is that possibly the same Absoft Graphics package?

Additionally to the resources already mentioned:

  • EGGX/ProCALL is an X11 graphics library for C/C++ and FORTRAN 77, maintained by Chisato Yamauchi since 1999. I’ve written interfaces for modern Fortran that include some example programs.
  • SDL 77 is my not-so-serious attempt of a FORTRAN 77 graphics library targeting SDL 1.2. The repository features some demo programs as well.
  • My fortran-sdl2 library provides modern interface bindings to the SDL 2.0 graphics library, for 2D and 3D game programming. I’ve written a short introduction on how to call the library from Fortran. Andre Smit created additional bindings to SDL2_gfx.
  • raylib is another 2D/3D graphics library, for which I’ve implemented bindings: fortran-raylib, also with an overview.
  • F03GL is a Fortran 2003 interface library to access OpenGL, GLU, and GLUT, mostly for but not limited to 3D programming.
  • For Microsoft Windows, bindings to DirectX are available.
  • Fastgraph is a commercial and once somewhat popular graphics library for DOS and Windows that supports only the Microsoft FORTRAN 5.1 compiler. As it seems, it is not actively sold anymore, but version 3.0.3 for DOS is on archive.org.
3 Likes

Another graphics library is PGPLOT. It seems not to be maintained now but it’s still available. It was written in f77 but I use it with modern gfortran.

It seems that much has not changed. Many graphics programs have come and gone. My last picture

11 Likes

@Earl thanks for posting here. That’s exciting what you do. If you have any issues with Fortran, let us know!

3 Likes

Thanks @Earl for posting it. It seems most of your works are about faces, using a vertical symmetry. Can you comment on that?

I read on your website:

all of his work is created by one of thirty computer programs he has developed & then colorized by hand in Photoshop.

Are your Fortran pictures generated in B&W or grey levels? How many hours or days does it take to color them?

I use Simply Fortran. It includes the AppGraphics library that supports a variety of drawing primitives for creating custom graphics.

2 Likes