Author Topic: Linux software to convert lists of numbers (e.g. Seek tiffs) into color images  (Read 149 times)

0 Members and 1 Guest are viewing this topic.

Offline IwuzBornanerd

  • Frequent Contributor
  • **
  • Posts: 270
  • Country: us
I tried to make the title more descriptive but the system wouldn't let me make it longer.

In earlier posts where this topic has come up I have said that I have a "crude" program to read Seek tiffs.  There are 2 reasons I called it crude:

1) It was 2 programs; one to read the tiff & write the 2nd & 3rd page data to plain text files, and a second program to read the text files & display an image.  And that second program was adapted from my camera driving program.

2) There is no "file open dialog" so it was not possible to start the program & then select a file to process.  Initially I even had to change the code & recompile to load a different file(!).

But as the topic has continued to come up and I used it more I have refined it to the point that I actually enjoy using it, but as is often said: "YMMV".  It is now one program & there is still no "file open dialog" (since SDL2 has none), but it can be set up as an "open with" selection when you right-click on a file name.  AND now someone has actually asked for the program, so I am going to "toss it out there" and see what happens.  I have tried to make installation as simple as I can and in so doing have found that someone will probably have trouble no matter what I do.

What it is capable of:
  • It will read Seek tiffs as they are & display the "page 2" temperature list as an image.
  • It will read plain text files containing lists of numbers, one per line or all on one line with spaces between (as in Thermviewer files).
  • If it detects a list of floating point values, one per line, it will assume they are temperatures in degrees C.
  • Lists of integer values will be converted to bogus temperatures because I can't be sure how to interpret them.  I sort of want to make that configurable but am putting this out there as is to see if anyone has better options.
  • The image width & height will be determined from the number of values & based on the sizes listed in the config file. So if a size you need is not already there you can add it.
  • Any one of a number of palettes can be applied to the numbers.  Colors will be applied linearly to the numbers in the file.  Palettes are read in from 24 bit RGB bmp files listed in the config file so you can add your own or subtract some if you like.
  • The range of temperatures/numbers spanned by the palette is fully adjustable in "User span mode" and is defaulted to auto-span the entire range of values in the file.
  • Images can be saved in jpeg format, either the entire window including the palette bar or just the image, or both, as specified in the config file.  A special path can be specified in the config file to save images to or they will be saved to the same directory as the input file.

I have not implemented any image rotation & Seek tiffs seem to sometimes end up rotated inexplicably.  The Thermviewer files appear to be written right to left instead of left to right & I don't know if that is consistent or not & I have not tried to correct for it; although I think it would be fairly easy to do.

To install the program, first unzip the archive into your home directory.   If using Xarchiver, make sure the "ensure containing folder" box is NOT checked (that box was not there under Wheezy).  This should place a configuration directory ".TImanipulator" and a program directory "TImanipulator" under your home directory.

Then, if you are using a Debian system (such as Raspbian on Raspberry Pi) you can run the shell script (note the capital I).   Open a terminal in the TImanipulator directory & type ./  If noting happens make sure the execute "permission" is set on the file, and that there were no typos.

IF you are NOT using Debian/Raspbian, you will have to install the SDL2, OpenCV & libtiff development packages in your normal way.  The necessary packages are libsdl2-dev, libsdl2-ttf-dev, libopencv-highgui-dev, libopencv-core-dev, libopencv-imgproc-dev, & libtiff5-dev.  Installing these should also cause their dependencies to be installed.

One of the main ways I tested this was to take the Raspbian Buster July image I had downloaded last year, burned it to a uSD card, booted that on a Pi3A+, ran "sudo apt-get update" & then upgrade; THEN I had to run "sudo apt full-upgrade" to keep pcmanfm from crashing.  Then I unzipped my archive & ran the install script.  Then I set up the "open with" option & ran the program on several files & tested the operation.  I also tested it on Raspbian stretch on that Pi and with Debian Buster on my laptop.  As far as I know the procedure & program works fine in all those cases, with the caveat that anything older than Buster does not need 2 of the shared libraries specified in the makefile.  So if you want to install it on older systems, read the makefile before compiling to hopefully avoid errors related to those libraries.

Linux being Linux, there are bound to be other issues on other systems.  If anyone finds such anomalies please post them on this thread.

The program & TImanipulatorReadme,html instructions are in the attached zip file.
I am not opposed to exercise, unless it is an exercise in futility.

Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo