FFT(): Specified real and imaginary parts have non 2^N dimension along the Y-axis

I am trying to use the rodilius filter on an image using the g’mic CLI installed through brew (brew install gmic) on a mac but I am getting the following error: “Specified real and imaginary parts have non 2^N dimension along the Y-axis)”

Any ideas what can be done to fix this issue?

Here’s the relevant log:

gmic -input input/world.jpg rodilius 10,4,400,16 smooth 60,0,1,1,4 normalize_local 10,16 -output output/world_rodilius.jpg
[gmic]-0./ Start G’MIC interpreter.
[gmic]-0./ Input file ‘input/world.jpg’ at position 0 (1 image 1024x1024x1x3).
[gmic]-1./ Apply rodilius filter on image [0] with amplitude 10, thickness 4, sharpness 400, 16 orientations, offset 0 and brighter color mode.
[gmic] *** Error in ./rodilius/*repeat/*local/(…)/*local/convolve_fft/*repeat/*local/ *** Command ‘fft’: gmicList::FFT(): Specified real and imaginary parts (1280,1280,1,3) have non 2^N dimension along the Y-axis.
[gmic] Command ‘fft’ has the following description:

fft (+):
    _{ x | y | z }...{ x | y | z }

  Compute the direct fourier transform (real and imaginary parts) of selected images,
  optionally along the specified axes only.

  Example: [#1]  image.jpg luminance +fft append[-2,\
             -1] c norm[-1] log[-1] shift[-1] 50%,50%,0,0,2

           [#2]  image.jpg w2={int(w/2)} h2={int(h/2)} fft shift $w2,$h2,\
             0,0,2 ellipse $w2,$h2,30,30,0,1,0 shift -$w2,-$h2,0,0,2 ifft remove[-1]

  Tutorial: https://gmic.eu/tutorial/_fft.shtml

Hi and welcome!

Are you using the latest version of gmic?

@manymanyjeans Welcome to the forum! I don’t like jeans very much. :stuck_out_tongue:

I tried your command as follows and it works as expected in Version 2.8.0. Could you upload your input image for us? (As a new member, you might have to post some more first…)

> gmic sp tiger rodilius 10,4,400,16 smooth 60,0,1,1,4 normalize_local 10,16 o rod-tiger.png
[gmic]-0./ Start G'MIC interpreter.
[gmic]-1./ Input sample image 'tiger' (1 image 750x500x1x3).
[gmic]-1./ Apply rodilius filter on image [0] with amplitude 10, thickness 4, sharpness 400, 16 orientations, offset 0 and brighter color mode.
[gmic]-1./ Smooth image [0] anisotropically, with amplitude 60, sharpness 0, anisotropy 1, alpha 1, sigma 4, dl 0.8, da 30, precision 2, nearest-neighbor interpolation and fast approximation enabled.
[gmic]-1./ Normalize image [0] locally, with amplitude 10, radius 16, neighborhood smoothness 4% and average smoothness 2%.
[gmic]-1./ Output image [0] as png file 'rod-tiger.png' (1 image 750x500x1x3).
[gmic]-1./ End G'MIC interpreter.

Definitely a broken package issue.
The CLI tool has been compiled without linking it against the libfftw, so this error appears.
The package maintainer must enable the libfftw when compiling G’MIC (which is usually enabled by default), to let G’MIC compute the FFT of images with arbitrary sizes.

Hi Paperdigits! I am using gmic: stable 2.8.1

@afre they are using homebrew, a package manager for macOS, as noted in their original post. Homebrew build their own package, so its an error on homebrew’s part.

The gmic package lists fftw, but not libfftw. Not sure of the difference. homebrew-core/gmic.rb at master · Homebrew/homebrew-core · GitHub

Until homebrew corrected the package you could try the build (with macports, without installing macports) from Releases · aferrero2707/gimp-plugins-collection · GitHub (gmic-qt plugin) or from Release Continuous build · aferrero2707/gmic-osx · GitHub (gmic cli).

Hi there, I’m a maintainer for the Homebrew project. Just to make sure everyone’s on the same page, we’re tracking this issue downstream at g'mic not supporting FFT properly · Issue #48196 · Homebrew/homebrew-core · GitHub.

2 Likes

@alebcay thank you for all your work and for reporting back! Welcome to our community.

We’ve rebuilt the package on our end and added tests into our CI that specifically run the rodilius filter, similar to the use case provided here, to verify that the fftw linkage is working correctly. These new CI tests have all passed, so we’re pretty sure things should be fixed now.

Thanks, and please let me know if the issue’s not resolved.

2 Likes