2021-03-26 by P.A.Semi

Technical description of Solar image processing

Contents: Eval Library, Image sources, Colors, Sharpening methods, Video encoding.

Eval library

For Solar image processing I use my own Eval programming language and libraries. It is built for win32 platform, but someone has reported using it on i386 Linux using Wines emulator...
For me it is four-level programming, because the core interpretter is written in Pascal and Assembler, above which are objects like Bitmap or Floatmap, written in highly optimized Pascal and Assembler, above which are script libraries like FlowLib.lib, and on top of that is an often simple script program, which can be written usually on a single line of code using eval.exe command-line interpretter...

Object Bitmap is 32-bit 2D bitmap with bytes 0..255 for red,green,blue,alpha (transparency).
Object FloatMap is 32-bit floating-point 2D map for a single channel... While it's not limited to some specific range, usually a range 0..1 is used for image operations...

Image sources

Images use either JPEG sources from NASA SDO browse web-site, or Fits files from JSOC/AIA and JSOC/HMI at Stanford, or Fits files from NSO...


For coloring data files, I use these palettes:

Sharpening methods

Multiple sharpening methods are used:

Video encoding

For video encoding I use ffmpeg and their H.264 codec via image2pipe ...

For example - when Jpegs are pre-generated for video:
eval.exe -lib MpegLib -v In=..\*.jpg "var V:=VideoEncoder({Width:1024,Height:1024,crf:24,fps:12});EnumFiles(In,#f(N,O){V.CopyFrom(OpenFile(O.FullName))})"
More complicated - when images need adding time-code, batch similar to this may be used:
set IN=..\*.jpg set OUT=OutputFile.mp4 set START=var V:=VideoEncoder({Width:1024,Height:1024,crf:25,fps:12},'%OUT%'); set LOADCODE=var B:=LoadImage(O.FullName),D:=DetectFileDate(N); set TEXTCODE=B.SetFont('DejaVu Serif',10,'white');B.TextOut(1,B.Height-B.LineHeight-1,FDt(D,'yyyy-mm-dd hh:nn')); set OUTCODE=B.SaveToStream(V,'.jpg'); eval.exe -lib MpegLib -lib FlowLib "%START% EnumFiles('%IN%',#f(N,O){%LOADCODE% %TEXTCODE% %OUTCODE%})"
FFMpeg gets this command-line:
C:\Util\Video\FFmpeg\bin\ffmpeg.exe -framerate 12 -r 12 -f image2pipe -i - -movflags +faststart -framerate 12 -r 12 -s 1280x1024 -pix_fmt yuv420p -c:v libx264 -b:v 8388608 -crf 25 -r 12 -movflags +faststart "OutputFile.mp4" (I'm not sure now why but it seemed to need to get same params multiple times...)