Hacker News new | past | comments | ask | show | jobs | submit login

You can try with Imagemagick (https://legacy.imagemagick.org/Usage/fourier/#im_fft) :

    for quality in 50 75 90 95 99 ; do
      # FFT
      convert source.png -fft +depth +adjoin source_fft_%d.png
      
      # compress FFT magnitude and phase
      convert source_fft_0.png -quality $quality source_fft_magnitude.jpg
      convert source_fft_1.png -quality $quality     source_fft_phase.jpg
    
      # IFFT
      convert source_fft_magnitude.jpg source_fft_phase.jpg -ift out.$quality.png
    done



Thanks, this is great. I found it works a lot better if you leave the magnitude alone and only mess with the phase.

The image is still recognisable even at quite harsh compression of the phase file, but almost totally unrecognisable at even minor compression of the magnitude file.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: