How to read and write images?

In this Fortran test example, I have implemented image compression using low-rank SVD.

John_W_Backus John_W_Backus_com

However, when it comes to reading and writing images into an array, I am currently using two Python scripts: image_to_pixels.py and pixels_to_image.py. I am wondering if there are any Fortran solutions available for reading and writing images.

2 Likes

Since you’re using JPEGs, probably this guy: GitHub - libjpeg-turbo/libjpeg-turbo: Main libjpeg-turbo repository

Actually reading libjpeg documentation I quickly decided to go back to GitHub - jtsiomb/libimago: Simple C library for loading and saving images in multiple file formats , it just lists libjpeg as a requirement, which is why I went directly there the first time.

1 Like

Thanks, @tyranids! I have started a new project to test out libimago.

1 Like