News for hackers. Stuff that matters.
Re:Moiré No More by planede on Wednesday January 04, 2023 @09:49AM (#34246095)
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.

Re:Moiré No More by stared on Wednesday January 04, 2023 @12:51PM (#34248904)
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.
Re:Moiré No More by TheRealPomax on Wednesday January 04, 2023 @02:20PM (#34250087)
Technically it's not, but your description is, because of the words "grid of dots", which means there's white space between the dots (as dots are circular), a necessary requirement for the Moiré effect. We see this in image sensors as well, where all photosites have a tiny amount of space between them.

Image resizing isn't a grid of dots, though. At the data level, pixels don't have space between each pixel to cause Moiré effects. Instead, interpolation of the colors leads to patterns similar to, but distinct from, the Moiré effect.

The Moiré effect is "not really there" in that it's a perceptual effect: you can reproduce it with an SVG with the same dot pattern on two layers, and transforming one of them a little. A human observer will "see" patterns that aren't actually there, and as you zoom in the effect disappears (if you're now thinking "because it's on a monitor!", then no: it's not. The same is true for two physical transparencies with the same dot pattern placed slightly shifted on an old school projector, and then changing the zoom on the projector)

Antialiasing is a data property: it can result from lossy interpolating of pixels to a new grid, and is there no matter how much you zoom in because zooming in on a pixel doesn't change its color.

The confusion comes from talking about Moiré patterns on grid based displays. Those will "lock in" or even intensify the effect, but they don't cause the effect.

Re:Moiré No More by jbay808 on Wednesday January 04, 2023 @02:57PM (#34250552)
There's not much you can do to fix it in software, but you can fix it in the optics. You can add a Moiré filter to the camera, which is an optical low-pass filter, ensuring that the image that reaches the sensor does not have any spatial-frequency components above the Nyquist frequency of the sensor (ie, twice the pixel pitch).