Live data from Hacker News

Moiré no more (2021)

newsletter.shifthappens.site

11–20 of 34 posts

Re: Moiré no more (2021)

#11
post #5

I wonder what would be the more systematic approach than manually painting over the fft image? That constellation of peaks in fft should be reasonably easy to recognize (semi-)automatically, then you'd need to figure out good mask for those.. is it a circular blob, or maybe diamond/star shape? And what size is best? Etc etc.

[deleted]

Re: Moiré no more (2021)

#12
post #10
post #5

I wonder what would be the more systematic approach than manually painting over the fft image? That constellation of peaks in fft should be reasonably easy to recognize (semi-)automatically, then you'd need to figure out good mask for those.. is it a circular blob, or maybe diamond/star shape? And what size is best? Etc etc.

It has been a long time since I have done anything in this domain (20+ years), but if I understand correctly, the original article author is essentially filtering out high frequency signals by painting over the bright FFT spots, essentially creating a localized low-pass filter or maybe band-pass filter. FFT essentially just transforms data into its frequency domain, so I assume the representation shown in the article…

I dont believe that by painting over the bright FFT spots you are necessarily removing the high frequencies. Instead, you are removing the strong frequencies from the image. The strong frequencies cause peaks in the FFT image. Its the repetitive nature of the moire effect that cause peaks in the FFT image.

Re: Moiré no more (2021)

#13
post #5

I wonder what would be the more systematic approach than manually painting over the fft image? That constellation of peaks in fft should be reasonably easy to recognize (semi-)automatically, then you'd need to figure out good mask for those.. is it a circular blob, or maybe diamond/star shape? And what size is best? Etc etc.

I think I 'd start with simple generated images first, like a sine wave rendered with dots, to get some initial insights.

Re: Moiré no more (2021)

#14
post #10

Earlier quoted context omitted.

It has been a long time since I have done anything in this domain (20+ years), but if I understand correctly, the original article author is essentially filtering out high frequency signals by painting over the bright FFT spots, essentially creating a localized low-pass filter or maybe band-pass filter. FFT essentially just transforms data into its frequency domain, so I assume the representation shown in the article…

I dont believe that by painting over the bright FFT spots you are necessarily removing the high frequencies. Instead, you are removing the strong frequencies from the image. The strong frequencies cause peaks in the FFT image. Its the repetitive nature of the moire effect that cause peaks in the FFT image.

Ahhh, so perhaps the position indicates the frequency and the brightness indicates the magnitude of the frequency? That makes sense - in that case the atricle's approach feels more like you said, a manually applied band pass or comb filter, i.e. it either removes or attenuates signals within certain frequency ranges.

Re: Moiré no more (2021)

#15
post #10

Earlier quoted context omitted.

It has been a long time since I have done anything in this domain (20+ years), but if I understand correctly, the original article author is essentially filtering out high frequency signals by painting over the bright FFT spots, essentially creating a localized low-pass filter or maybe band-pass filter. FFT essentially just transforms data into its frequency domain, so I assume the representation shown in the article…

I dont believe that by painting over the bright FFT spots you are necessarily removing the high frequencies. Instead, you are removing the strong frequencies from the image. The strong frequencies cause peaks in the FFT image. Its the repetitive nature of the moire effect that cause peaks in the FFT image.

Indeed, the frequencies get higher further away from the center of the FFT image with the center being the "DC" component of the signal. The brightness, as you note, correspond to the amplitude of a given frequency.

you can think of it as a polar plot where: radius = frequency, angle = angle (as in points along the horizontal direction in the FFT correspond to e.g. vertical stripes in the image), brightness = power

There is an imaginary part to the FFT that contains the phase-shifts needed to add everything back up into the original image. You may have noticed that the "FFT of the image" is symmetric, so something else should be needed to compute the inverse.

Re: Moiré no more (2021)

#17
post #10

Earlier quoted context omitted.

It has been a long time since I have done anything in this domain (20+ years), but if I understand correctly, the original article author is essentially filtering out high frequency signals by painting over the bright FFT spots, essentially creating a localized low-pass filter or maybe band-pass filter. FFT essentially just transforms data into its frequency domain, so I assume the representation shown in the article…

I dont believe that by painting over the bright FFT spots you are necessarily removing the high frequencies. Instead, you are removing the strong frequencies from the image. The strong frequencies cause peaks in the FFT image. Its the repetitive nature of the moire effect that cause peaks in the FFT image.

Another nice property of the FFT is that convolution in image space is multiplication in frequency space, so multiplying the FFT with an image of a Gaussian (or any other linear kernel such as an edge detector) is exactly equivalent to applying the filter on the original image.

Re: Moiré no more (2021)

#18

So all the people who insisted nothing could be done were just ignorant of what could be done?

A sage reminder to all of us that sometimes it's better to upvote & listen (or in this case heart/retweet) to see if a better response surfaces than to offer our two cents.

Re: Moiré no more (2021)

#19
I obtained a similar effect with The Gimp and the wavelet decomposition plugin[1] that splits the picture in various layers containing details at different granularity. You can then simply remove the "bad" ones. On portraits, you can remove freckles and wrinkles very easily this way, too.

[1]: https://docs.gimp.org/2.10/en/plug-in-wavelet-decompose.html

So I tried it on his image and here's how it looks with default settings:

https://demo.intellique.org/nextcloud/index.php/s/SsgWGczo6G...

Much less work :)

Re: Moiré no more (2021)

#20
post #8

When you get Moiré from the sensor of a camera or scanner, then there is nothing much you can do. But extreme Moiré effect from resizing is not really Moiré. It's aliasing. And it typically happens because the resizing happens in a non-linear colorspace and/or with a poor kernel. Unfortunately this mistake is quite common in many image processing software.

Aliasing IS a type of Moiré. Take an image, and impose it on a grid of dots - and you get the same afect as from naive resampling.
Post reply on HN