siril-cli: how to save fit file as jpg so that a color jpg is created

Hello,
while waiting for an official release of 1.1.0, I have implemented a simple livestack with some shell scripting around siril-cli.
When I check with siril-gui the resulted fit file and do an autostretch, it looks ok.
However I would like to safe the stacked fit result as a jpg (using the command “savejpg”) and get a color image, how can this be done with siril-cli (I tried the commands “asinh stretch”, “mtf” but to no avail).
Thanks,
AstroRookie

what version do you use now?

I’m using 1.0.5

$ siril-cli -version
siril 1.0.5

it’s a bit sad to spend time doing this while it’s already available in the development version, both live stacking and autostretch. If you really need it to you can use statistics (stat command) of the image to compute the mtf parameters, like autostretch does…

Hello Vincent,

you’re absolutely right, but it was only when I’ve found this Siril:Commands - FreeAstro linked to from Siril - Docs that I noticed the commands “start_ls”, “stop_ls”, “livestack” (but for version 1.1.0) … and that I was sort of “re-inventing the wheel”.
So maybe I should indeed spent my time trying to install the development version.
And thanks for the “stat” hint.

AstroRookie

Hello Vincent,

sorry to bother once more.
I tried to build the latest version from git on my “old” macbook (OS: OS X monterey, Intel Core i5) with xcode installed and I get ther following error:

-- The CXX compiler identification is AppleClang 14.0.0.14000029
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/usr/bin/g++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/usr/bin/g++ -- broken
CMake Error at /opt/local/share/cmake-3.16/Modules/CMakeTestCXXCompiler.cmake:53 (message):
  The C++ compiler

    "/Applications/Xcode.app/Contents/Developer/usr/bin/g++"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /Users/geert/projects/siril/subprojects/librtprocess/build/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/opt/local/bin/gmake cmTC_ee7b0/fast && gmake[3]: Entering directory '/Users/geert/projects/siril/subprojects/librtprocess/build/CMakeFiles/CMakeTmp'
    /opt/local/bin/gmake -f CMakeFiles/cmTC_ee7b0.dir/build.make CMakeFiles/cmTC_ee7b0.dir/build
    gmake[4]: Entering directory '/Users/geert/projects/siril/subprojects/librtprocess/build/CMakeFiles/CMakeTmp'
    Building CXX object CMakeFiles/cmTC_ee7b0.dir/testCXXCompiler.cxx.o
    /Applications/Xcode.app/Contents/Developer/usr/bin/g++  -std=c++11    -D_FILE_OFFSET_BITS=64 -Werror=unknown-pragmas -Werror=unused-label -fno-common -ftree-vectorize -fno-math-errno -O2 -Xpreprocessor -fopenmp -lomp  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -fPIE   -o CMakeFiles/cmTC_ee7b0.dir/testCXXCompiler.cxx.o -c /Users/geert/projects/siril/subprojects/librtprocess/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
    clang: warning: -lomp: 'linker' input unused [-Wunused-command-line-argument]
    Linking CXX executable cmTC_ee7b0
    /opt/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_ee7b0.dir/link.txt --verbose=1
    /Applications/Xcode.app/Contents/Developer/usr/bin/g++  -std=c++11  -D_FILE_OFFSET_BITS=64 -Werror=unknown-pragmas -Werror=unused-label -fno-common -ftree-vectorize -fno-math-errno -O2 -Xpreprocessor -fopenmp -lomp  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names   CMakeFiles/cmTC_ee7b0.dir/testCXXCompiler.cxx.o  -o cmTC_ee7b0 
    ld: library not found for -lomp
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    gmake[4]: *** [CMakeFiles/cmTC_ee7b0.dir/build.make:87: cmTC_ee7b0] Error 1
    gmake[4]: Leaving directory '/Users/geert/projects/siril/subprojects/librtprocess/build/CMakeFiles/CMakeTmp'
    gmake[3]: *** [Makefile:121: cmTC_ee7b0/fast] Error 2

I executed:

./autogen.sh
make

(but I did have to do a export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:/usr/local/Cellar/exiv2/0.27.5_1/lib/pkgconfig" because autogen.sh complained about exiv2 not being found)

I compiled a “hello world” with:

g++ -o hello -lomp hello.c

and it worked with only a warning:

clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]

However when invoking the same compiler/link command on the “hello world” I get the same error:

/Applications/Xcode.app/Contents/Developer/usr/bin/g++  -std=c++11    -D_FILE_OFFSET_BITS=64 -Werror=unknown-pragmas -Werror=unused-label -fno-common -ftree-vectorize -fno-math-errno -O2 -Xpreprocessor -fopenmp -lomp  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -fPIE -o hello hello.c
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
ld: library not found for -lomp
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Thanks,

AstroRookie

Compiling on macOS is not an easy task.
You need to install all prerequisite packages with homebrew.
Then I would advice to use ninja and meson, as explained in our README rather than autotools.

Hello,
not an easy task: I agree :slight_smile:
I updated the configure file by removing the -lomp option but run into an other problem:

algos/quantize.c:1248:22: error: implicit declaration of function 'omp_get_num_threads' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                if (threads > 1 && omp_get_num_threads() != threads)
                                   ^
algos/quantize.c:1249:115: error: implicit declaration of function 'omp_get_level' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                        siril_debug_print("actual number of threads: %d of %d requested (level %d)\n", omp_get_num_threads(), threads, omp_get_level());
                                                                                                                                       ^
algos/quantize.c:1397:22: error: implicit declaration of function 'omp_get_num_threads' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                if (threads > 1 && omp_get_num_threads() != threads)
                                   ^
algos/quantize.c:1398:115: error: implicit declaration of function 'omp_get_level' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                        siril_debug_print("actual number of threads: %d of %d requested (level %d)\n", omp_get_num_threads(), threads, omp_get_level());

Let me try ninja and meson as you suggest (but I don’t know either of these)

Thanks,

AstroRookie

@vinvin , @lock042 ,

guys, you made my day! :clap:

siril 1.1.0-488522e5
-:_build auser$ siril-cli -version
siril 1.1.0-488522e5

Thank you so much!

AstroRookie