Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Linux command that does excact same as Gmic Fourier Transform
#1
Hi.

OS: Fedora 41 KDE

I'm looking for a way to execute a command in Linux that are capable to produce two new files and also the reverse transform.

I have tried and also read up on the topic, but I'm stuck and get nowhere by this point.


This is what I have done so far, I'm stuck on both methods

1. Install the G'MIC 2.9.6 - Flathub

This make the command 'gmic' available in the Terminal. I've tried to read online, and also ran '$ man gmic | grep -i -b2 -a1 fourier' to see if I could extract key info on how to, but the man page doesn't give an actual real life example on how to actually run the command. So I'm still stuck, unsure if this is even possible.


2. using the -fft flag on the magick command

The magick tool seemingly have a command to do fourier analysis on an image file. The actual command I used was this one for a sample photo 'magick Nokia3210_cover-grå.jpg -fft Nokia3210_cover-grå_fft.png'.

This seemingly works- it output two files (automatically adding -0 and -1 at the end of the specified file name). However at opening the resulting image "Nokia3210_cover-grå_fft-0.png" - it consist of almost all black pixels, and does not resemble the result from when I run the Gmic Fourier Transform filter from within Gimp.

This together with the issue of not being able (don't know) how to do the reverse transform using command line makes it so that I do not know how to progress from here, if possible.
Reply
#2
(09-12-2025, 09:34 PM)Grobe Wrote: 1. Install the G'MIC 2.9.6 - Flathub  

Ask the question on the https://discuss.pixls.us/  forum.  The gmic command line people are there.

Quote:2. using the -fft flag on the magick command

First of all, does your version of Imagemagick 7 (IM7) come with fft enabled. With kubuntu 24.04 I use the magick appimage provided but that does not come with fft. I had to compile a (static) version with fft.  Looks like you have it, with the xxx-0.png and xxx-1.png output, but for a check.

In a terminal what does magick -version tell you ? There should be a delegate for fft as:

Delegates (built-in): fftw fontconfig freetype jbig jng jpeg lcms lzma openexr pangocairo png webp x zlib

Then it is all as http://www.fmwconcepts.com/imagemagick/f...tml#im_fft and you have to go way down to find the bit about denoising.

Code:
magick noisy.jpg +depth -fft n.png
gives n-0.png and n-1.png

Same as using the Gimp fft plugin you need to edit the defects map and maybe something like this as a mask. (scaled as an example - has to match the image size)
   

and combine with n-1.png
Code:
magick n-1.png mask.png  -compose multiply -composite  n-1a.png

then use that with the inverse fft
Code:
magick n-0.png  n-1a.png -ift denoised.png

...and comparing before / after not much change. Depends on original and mask.

   
Reply


Forum Jump: