# 2D DFT of an image?

**URL:** <https://www.ruby-forum.com/t/2d-dft-of-an-image/65694>\
**Category:** Ruby\
**Created:** [August 20, 2006, 5:32pm UTC](https://www.ruby-forum.com/t/2d-dft-of-an-image/65694 "2006-08-20T17:32:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![regularfry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@regularfry](https://www.ruby-forum.com/u/regularfry)\
**Post date:** [August 20, 2006, 5:32pm UTC](https://www.ruby-forum.com/t/2d-dft-of-an-image/65694/1 "2006-08-20T17:32:55Z")

</div>

Hi all,

What’s the easiest way to get the 2D DFT of an image? I can take care  
of zero- or mean-padding via RMagick easily enough, and I presume  
ImageMagick uses the DFT internally to implement convolutions, but I  
can’t see any easy way to get at the frequency data itself… Am I  
missing something, or am I going to have to marshall the pixel data from  
RMagick to NArray (or gsl, or…) manually? In that case, what’s the  
most efficient path?

I presume this is something that others deal with on a daily basis, but  
I’ve never had to tackle it from Ruby before.

Thanks,
