# Using FORTRAN to make pictures!

**URL:** <https://fortran-lang.discourse.group/t/using-fortran-to-make-pictures/7927>\
**Category:** Uncategorized\
**Created:** [April 30, 2024, 4:23am UTC](https://fortran-lang.discourse.group/t/using-fortran-to-make-pictures/7927 "2024-04-30T04:23:28Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Earl](https://avatars.discourse-cdn.com/v4/letter/e/ea666f/32.png) [@Earl](https://fortran-lang.discourse.group/u/Earl)\
**Post date:** [April 30, 2024, 4:23am UTC](https://fortran-lang.discourse.group/t/using-fortran-to-make-pictures/7927/1 "2024-04-30T04:23:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Earl](https://avatars.discourse-cdn.com/v4/letter/e/ea666f/32.png) [@Earl](https://fortran-lang.discourse.group/u/Earl)\
**Post date:** [April 30, 2024, 4:35am UTC](https://fortran-lang.discourse.group/t/using-fortran-to-make-pictures/7927/2 "2024-04-30T04:35:42Z")

</div>

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

```

---

<div class="post-metadata">

**Author:** ![Shahid](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/shahid/32/3672_2.png) [@Shahid](https://fortran-lang.discourse.group/u/Shahid)\
**Post date:** [April 30, 2024, 4:55am UTC](https://fortran-lang.discourse.group/t/using-fortran-to-make-pictures/7927/3 "2024-04-30T04:55:28Z")

</div>

I use [Dislin](https://dislin.de/index.html).

---

<div class="post-metadata">

**Author:** ![vmagnin](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/vmagnin/32/28_2.png) [@vmagnin](https://fortran-lang.discourse.group/u/vmagnin)\
**Post date:** [April 30, 2024, 8:18am UTC](https://fortran-lang.discourse.group/t/using-fortran-to-make-pictures/7927/4 "2024-04-30T08:18:37Z")

</div>

Welcome Earl to the Fortran Discourse!

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

> [@Anecdotal Fortran... slight\_smile](https://fortran-lang.discourse.group/t/anecdotal-fortran/704/394):
>
> On X/Twitter is [https://twitter.com/earleinhorn](https://twitter.com/earleinhorn), “The Father of Fortran Programmed Art”, with site [https://earleinhorn.art/](https://earleinhorn.art/) At 80 years old, Earl Einhorn is a living legend, known as the Father of Fortran Art he is one of the true pioneers of the entire computer programmed art world. Earl Einhorn began studying Electrical Engineering at CCNY but ended up in Mathematics. He started programming in Fortran in 1968 as the Master Actuarial Programmer for Equitable Life In 198…

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

---

<div class="post-metadata">

**Author:** ![vmagnin](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/vmagnin/32/28_2.png) [@vmagnin](https://fortran-lang.discourse.group/u/vmagnin)\
**Post date:** [April 30, 2024, 8:38am UTC](https://fortran-lang.discourse.group/t/using-fortran-to-make-pictures/7927/5 "2024-04-30T08:38:59Z")

</div>

> [@Earl](#):
>
> 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 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](https://github.com/vmagnin/gtk-fortran/wiki) library. Many people here use various graphical libraries to draw or plot. See those two lists:

- [Libraries for plotting data, handling images and generating user interfaces — Fortran Programming Language](https://fortran-lang.org/packages/graphics/)
- [GitHub - Beliavsky/Fortran-code-on-GitHub: Directory of Fortran codes on GitHub, arranged by topic](https://github.com/Beliavsky/Fortran-code-on-GitHub#graphics-plotting-and-user-interfaces)

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

> [@ForCAD - A Fortran library for Geometric Modeling](https://fortran-lang.discourse.group/t/forcad-a-fortran-library-for-geometric-modeling/7747/9):
>
> ForCAD now supports knot removal, embedding meshes into NURBS, retrieving IGA element connectivity, and includes some predefined NURBS shapes such as circle, half circle, tetragon, hexahedron, 2D ring, half 2D ring, 3D ring, half 3D ring. It also includes rotatation and translation of geometry and control geometry, along with visualization using PyVista. Below is an example of embedding meshes into a NURBS volume and visualizing it using PyVista. A logo has also been designed using Fo…

See also: [Binding to the GD graphics library](https://fortran-lang.discourse.group/t/binding-to-the-gd-graphics-library/4167) and [GitHub - gha3mi/forimage: ForImage - A Fortran library for processing and editing PNM images and managing colors.](https://github.com/gha3mi/forimage)

I am an amateur of graphism, and have played especially with Peter Saville’s work:  
[![](https://global.discourse-cdn.com/free1/uploads/fortran_lang/original/2X/1/14d95aba90bf1b24f2e2cd0be4596233437b47e2.png) ](https://raw.githubusercontent.com/vmagnin/gtk-fortran-extra/main/unknown_pleasures/screenshots/Fortran_unknown_pleasures_purple_text.png)

[![](https://global.discourse-cdn.com/free1/uploads/fortran_lang/original/2X/3/3e7cbdbe77095f9f9cf49dc2a854c27bccb6013a.png) ](https://raw.githubusercontent.com/vmagnin/gtk-fortran-extra/main/screenshots/saville_code.png)

---

<div class="post-metadata">

**Author:** ![vmagnin](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/vmagnin/32/28_2.png) [@vmagnin](https://fortran-lang.discourse.group/u/vmagnin)\
**Post date:** [April 30, 2024, 12:27pm UTC](https://fortran-lang.discourse.group/t/using-fortran-to-make-pictures/7927/6 "2024-04-30T12:27:15Z")

</div>

> [@Earl](#):
>
> I used Compaq-Digital FORTRAN and Absoft grapics package. I would like to update.

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](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](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.

---

<div class="post-metadata">

**Author:** ![Machalot](https://avatars.discourse-cdn.com/v4/letter/m/ebca7d/32.png) [@Machalot](https://fortran-lang.discourse.group/u/Machalot)\
**Post date:** [April 30, 2024, 6:04pm UTC](https://fortran-lang.discourse.group/t/using-fortran-to-make-pictures/7927/7 "2024-04-30T18:04:10Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![interkosmos](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/interkosmos/32/296_2.png) [@interkosmos](https://fortran-lang.discourse.group/u/interkosmos)\
**Post date:** [April 30, 2024, 7:28pm UTC](https://fortran-lang.discourse.group/t/using-fortran-to-make-pictures/7927/8 "2024-04-30T19:28:57Z")

</div>

Additionally to the resources already mentioned:

- [EGGX/ProCALL](https://www.ir.isas.jaxa.jp/~cyamauch/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](https://github.com/interkosmos/eggx-procall-2003) that include some example programs.
- [SDL 77](https://github.com/interkosmos/sdl77) 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](https://github.com/interkosmos/fortran-sdl2) library provides modern interface bindings to the [SDL 2.0](https://www.libsdl.org/) graphics library, for 2D and 3D game programming. I’ve written a [short introduction](https://cyber.dabamos.de/programming/modernfortran/sdl.html) on how to call the library from Fortran. Andre Smit created additional [bindings to SDL2\_gfx](https://github.com/freevryheid/fortran-sdl2_gfx).
- [raylib](https://www.raylib.com/) is another 2D/3D graphics library, for which I’ve implemented bindings: [fortran-raylib](https://github.com/interkosmos/fortran-raylib), also with [an overview](https://cyber.dabamos.de/programming/modernfortran/raylib.html).
- [F03GL](https://www-stone.ch.cam.ac.uk/pub/f03gl/index.xhtml) 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](https://ss1.xrea.com/pipan9737.g1.xrea.com/) are available.
- [Fastgraph](http://www.fastgraph.com/) 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](https://archive.org/details/blobby03_cracked).

---

<div class="post-metadata">

**Author:** ![Harper](https://avatars.discourse-cdn.com/v4/letter/h/b5ac83/32.png) [@Harper](https://fortran-lang.discourse.group/u/Harper)\
**Post date:** [May 1, 2024, 11:58pm UTC](https://fortran-lang.discourse.group/t/using-fortran-to-make-pictures/7927/9 "2024-05-01T23:58:55Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Earl](https://avatars.discourse-cdn.com/v4/letter/e/ea666f/32.png) [@Earl](https://fortran-lang.discourse.group/u/Earl)\
**Post date:** [July 2, 2024, 10:04pm UTC](https://fortran-lang.discourse.group/t/using-fortran-to-make-pictures/7927/10 "2024-07-02T22:04:36Z")

</div>

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

 ![Earl2775jpg](https://global.discourse-cdn.com/free1/uploads/fortran_lang/original/2X/9/9f550c1920a5ee5794af0694703f4109eb42f0c0.jpeg)

---

<div class="post-metadata">

**Author:** ![certik](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/certik/32/4_2.png) [@certik](https://fortran-lang.discourse.group/u/certik)\
**Post date:** [July 2, 2024, 11:05pm UTC](https://fortran-lang.discourse.group/t/using-fortran-to-make-pictures/7927/11 "2024-07-02T23:05:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![vmagnin](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/vmagnin/32/28_2.png) [@vmagnin](https://fortran-lang.discourse.group/u/vmagnin)\
**Post date:** [July 3, 2024, 7:44am UTC](https://fortran-lang.discourse.group/t/using-fortran-to-make-pictures/7927/12 "2024-07-03T07:44:47Z")

</div>

> [@Earl](#):
>
> My last picture

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](https://earleinhorn.art/art-images-earl-einhorn/):

> 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?

---

<div class="post-metadata">

**Author:** ![Dobrodzieju](https://avatars.discourse-cdn.com/v4/letter/d/c5a1d2/32.png) [@Dobrodzieju](https://fortran-lang.discourse.group/u/Dobrodzieju)\
**Post date:** [July 4, 2024, 9:59pm UTC](https://fortran-lang.discourse.group/t/using-fortran-to-make-pictures/7927/13 "2024-07-04T21:59:40Z")

</div>

I use [Simply Fortran](https://simplyfortran.com/). It includes the AppGraphics library that supports a variety of [drawing primitives](http://simplyfortran.com/docs/appgraphics/drawing.html) for creating custom graphics.

---

<div class="post-metadata">

**Author:** ![Earl](https://avatars.discourse-cdn.com/v4/letter/e/ea666f/32.png) [@Earl](https://fortran-lang.discourse.group/u/Earl)\
**Post date:** [July 27, 2024, 1:27am UTC](https://fortran-lang.discourse.group/t/using-fortran-to-make-pictures/7927/14 "2024-07-27T01:27:42Z")

</div>

When I lost my eye I started to do Faces. I used symmetry because I could place my eyes and mouth in various places to get my faces! I also wanted to be recognized and when people see my eyes and mouth in a symmetrical picture they immediatly know it is me!

---

<div class="post-metadata">

**Author:** ![Earl](https://avatars.discourse-cdn.com/v4/letter/e/ea666f/32.png) [@Earl](https://fortran-lang.discourse.group/u/Earl)\
**Post date:** [July 27, 2024, 1:32am UTC](https://fortran-lang.discourse.group/t/using-fortran-to-make-pictures/7927/15 "2024-07-27T01:32:04Z")

</div>

At the beginning they were until I found a color library to write each pixel in 256 shades of RGB. which gave me 256x256x256 or 16.7 million colors! I worked in Photoshop to change colors in selected areas to change colors by selecting areas and changing the hue!

---

<div class="post-metadata">

**Author:** ![Earl](https://avatars.discourse-cdn.com/v4/letter/e/ea666f/32.png) [@Earl](https://fortran-lang.discourse.group/u/Earl)\
**Post date:** [July 27, 2024, 1:50am UTC](https://fortran-lang.discourse.group/t/using-fortran-to-make-pictures/7927/16 "2024-07-27T01:50:48Z")

</div>

At the beginning they were in B&W until I found a color library to write each pixel in 256 shades of RGB. which gave me 256x256x256 or 16.7 million colors! I worked in Photoshop to change colors in selected areas to change colors by selecting areas and changing the hue or other techniques in Photoshop.
