Pages: [1]   Go Down

Author Topic: Printer induced Moire  (Read 2065 times)

Doug Gray

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2197
Printer induced Moire
« on: March 24, 2016, 06:20:13 pm »

I just ran some tests and noticed that my Canon 9500 II produces significant moiré when printing an image at 300 PPI if the repeating patterns are high enough in frequency. If I first resample/resize the image to 600 PPI the moiré almost vanishes. Also, moiré is reduced if the image being printed is in a normal gamma colorspace. It's significantly more sensitive if the gamma is 1.  This indicates that the driver is printing based on the regions around the pixels. Even at 300 PPI. The driver has no knowledge of the image's colorspace and apparently assumes the raw RGB values it gets are in a high gamma. It then corrects for that gamma (linearlizes it) when resampling the image to print.  No idea if that is done in the device driver or the printer itself.
Logged

Bart_van_der_Wolf

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 8914
Re: Printer induced Moire
« Reply #1 on: March 24, 2016, 07:57:41 pm »

I just ran some tests and noticed that my Canon 9500 II produces significant moiré when printing an image at 300 PPI if the repeating patterns are high enough in frequency. If I first resample/resize the image to 600 PPI the moiré almost vanishes.

Hi Doug,

Yes, that's to be expected. That's one of the reasons (besides higher resolution and better sharpening capability) why I recommend to use 600 PPI (or 720 PPI on Epsons). I also created (and improved with some feedback from LuLa readers) a test target that allows to determine if head alignment or paper feed issues add to the artifacts, and it allows to determine the actual resolution that a given paper allows to reach.

Quote
Also, moiré is reduced if the image being printed is in a normal gamma colorspace.

Depending on the pattern, a correct gamma (a good profile) gives the least trouble.

Quote
It's significantly more sensitive if the gamma is 1. This indicates that the driver is printing based on the regions around the pixels. Even at 300 PPI. The driver has no knowledge of the image's colorspace and apparently assumes the raw RGB values it gets are in a high gamma. It then corrects for that gamma (linearlizes it) when resampling the image to print.  No idea if that is done in the device driver or the printer itself.

I think it's the gamma itself that exacerbates moiré, but too low a gamma will also print too dark anyway.

My Canon 9500 II has trouble printing the very critical target without artifacts, but then the target is much more sensitive than most normal subject matter.

Cheers,
Bart
Logged
== If you do what you did, you'll get what you got. ==

Doug Gray

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2197
Re: Printer induced Moire
« Reply #2 on: March 25, 2016, 12:13:10 am »

Hi Bart,

That's a really great printer target you have there. I've been going along believing, incorrectly it turns out, that if an image doesn't have frequencies close to Nyquist at 300 DPI then nothing was to be gained by running the Canon with a higher DPI image. That clearly is not the case. Even when the image has frequencies that can be fully resolved at 200DPI there is some aliasing when printing at 300DPI and hence there is a benefit to upsampling even if no sharpening is done.

While the printer resolution has not been something I've thought about much I've been very interested in measuring sensor aliasing and developed a similar target of concentric sine waves for investigating this. The target is quite large and LPI very low but shot at a distance it is easy to determine optimal aperture on various cameras. For instance F22 on a 1DsIII and F16 on a 5Ds R both are happy spots where color artifacts from CFA aliasing is minimized. Twice as large an aperture works great on B&W "document mode" imaging using dcraw and removing the CFA effects.  At least on lenses with low chromatic aberration.

Another target is made of concentric patterns of 7 overlapping sine waves each of which has the same amplitude. Running FFTs on that yields excellent MFT responses correlating nicely with camera motion from mirror slap and first curtain mechanical induced movement. These cause a kind of low pass filter effect along a motion vector. At least to first order.

But I've been ignoring the printer!  When I was printing some 5Ds R images on smallish (6x9) sheets I was initially downsampling to 300 DPI thinking that it would reduce aliasing and noticed some odd results in fine, repetitive patterns that were not there in the original 5Ds R image. So I took my targets used for sensors, downsampled 10x, and printed them but with freqs still below Nyquist and was surprised to see aliasing (Moire).

Now I see you had explored that road in depth!

Very interesting discussion in your link.  Good stuff Bart.

Thanks!,
Doug
Logged

Bart_van_der_Wolf

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 8914
Re: Printer induced Moire
« Reply #3 on: March 25, 2016, 04:47:55 am »

Hi Bart,

That's a really great printer target you have there. I've been going along believing, incorrectly it turns out, that if an image doesn't have frequencies close to Nyquist at 300 DPI then nothing was to be gained by running the Canon with a higher DPI image. That clearly is not the case. Even when the image has frequencies that can be fully resolved at 200DPI there is some aliasing when printing at 300DPI and hence there is a benefit to upsampling even if no sharpening is done.

Hi Doug,

Indeed. Even before image detail reaches the Nyquist limit, it takes very little to generate what seems like moiré but technically can't be. It's the quantization and gamma effects that cause that apparent moiré, but even if it is technically not aliasing, it can still look like it and distract in our images. The gamma effect can already be see on display when you look at the finer detail of my target at 100% zoom, and move your head up and down in front of the display. The minute change in gamma will generate patterns where there are none.

Oversampling is the best way to prevent as much of that as possible, and since it's cheap to do with printing (by switching on 600 or 720 PPI), I recommend making it the default practice.

Quote
While the printer resolution has not been something I've thought about much I've been very interested in measuring sensor aliasing and developed a similar target of concentric sine waves for investigating this. The target is quite large and LPI very low but shot at a distance it is easy to determine optimal aperture on various cameras. For instance F22 on a 1DsIII and F16 on a 5Ds R both are happy spots where color artifacts from CFA aliasing is minimized. Twice as large an aperture works great on B&W "document mode" imaging using dcraw and removing the CFA effects.  At least on lenses with low chromatic aberration.

Correct, at those apertures the MTF for green wavelengths/luminance reaches a response of zero at the Nyquist frequency, just like the theory of circular aperture diffraction with a very good lens predicts. You'll probably get almost similar results at 1/3rd a stop wider, due to residual lens aberrations that blur the image slightly.

The role of the Rawconverter is also a factor of importance. Some demosaicing algorithms extract more resolution from an image than others. Capture One, RawTherapee (with Amaze), and Iridient RAW developer (=Mac OS only) all have a good reputation of high resolution with a minimum of artifacts.

Quote
Another target is made of concentric patterns of 7 overlapping sine waves each of which has the same amplitude. Running FFTs on that yields excellent MFT responses correlating nicely with camera motion from mirror slap and first curtain mechanical induced movement. These cause a kind of low pass filter effect along a motion vector. At least to first order.

I'm also investigating simple/useful tools to assist in quantifying vibration blur. I believe you've posted (here on LuLa) about that method before, but I wondered how the varying magnification factor from focal length and shooting distance was calibrated. As camera resolution increases, so does the visibility of camera shake.

Quote
But I've been ignoring the printer!  When I was printing some 5Ds R images on smallish (6x9) sheets I was initially downsampling to 300 DPI thinking that it would reduce aliasing and noticed some odd results in fine, repetitive patterns that were not there in the original 5Ds R image. So I took my targets used for sensors, downsampled 10x, and printed them but with freqs still below Nyquist and was surprised to see aliasing (Moire).

Paper choice also makes a difference, which is what sparked my interest in designing such a target. Some papers exhibit more ink diffusion than others. But with well behaving paper coatings, it really pays off to print at the highest resolution (600 or 720 PPI) that the printer allows. It also helps with output sharpening.

Quote
Now I see you had explored that road in depth!

Very interesting discussion in your link.  Good stuff Bart.

I think it's always useful to share such stuff, so you're welcome

Cheers,
Bart.
Logged
== If you do what you did, you'll get what you got. ==

Doug Gray

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2197
Re: Printer induced Moire
« Reply #4 on: March 25, 2016, 12:52:25 pm »

Hi Bart,

Thanks for sharing. It gives me some ideas I'm going to check out.

Along the lines of camera motion what I'd really like to have is a way to measure positional change over time from induced camera motion. One precise way to do it would be with an array of, say, 32x32 LEDs where each one is turned on sequentially for, say, 100us, at intervals of 500us. This would allow capture of xy coordinate changes over half a second. It would be an easy way to measure camera motion blur for a specific lens, camera, tripod combo.  Would also be useful to characterize the response of lens image stabilization.

Arrays of LEDs are available dirt cheap as are driver electronics. It would be great to see this added to camera and lens evaluations.

https://learn.adafruit.com/connecting-a-16x32-rgb-led-matrix-panel-to-a-raspberry-pi

This is such a wonderful time we live in. Exploration tools are incredible.

Doug
Logged

Doug Gray

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2197
Re: Printer induced Moire
« Reply #5 on: March 25, 2016, 08:08:50 pm »

I've been experimenting with your 600DPI target. Printed directly at 600 or 300 (with or without image resizing from Photoshop) produces pretty bad artifacts.  OTOH, Resizing in Photoshop from 600 to 400 then back to 600 produces excellent results on the Canon 9500 II. It also eliminates the strange stuff that shows up when I print 5Ds R images at smaller sizes.

Thanks a lot Bart! What a wonderful find.
Logged

Bart_van_der_Wolf

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 8914
Re: Printer induced Moire
« Reply #6 on: March 26, 2016, 06:53:55 am »

I've been experimenting with your 600DPI target. Printed directly at 600 or 300 (with or without image resizing from Photoshop) produces pretty bad artifacts.

I did warn that it's a cruel target ... ;)

And the goal is to first reduce (100% elimination is very hard) the artifacts by improving head alignment and paper transport. Also make sure that the application and/or the driver that is used to print, doesn't change the size or PPi when exporting/printing (e.g. borderless printing will additionally resize the image to exceed the printable area).

Quote
OTOH, Resizing in Photoshop from 600 to 400 then back to 600 produces excellent results on the Canon 9500 II. It also eliminates the strange stuff that shows up when I print 5Ds R images at smaller sizes.

This tends to be somewhat similar to applying a Gaussian blur (a low-pass filter) at the original size. It seems a bit crude needing that to reduce aliasing artifacts. However, downsampling (for smaller size prints) will increase the risk of aliasing caused by the down-sampling algorithm. A pre-blur (or a better down-sampling algorithm) will reduce that aliasing risk, and some Output sharpening after the down-sampling will allow to restore pixel sharpness, especially when using 600 PPI.

Cheers,
Bart
Logged
== If you do what you did, you'll get what you got. ==

Bart_van_der_Wolf

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 8914
Re: Printer induced Moire
« Reply #7 on: March 26, 2016, 07:12:05 am »

Along the lines of camera motion what I'd really like to have is a way to measure positional change over time from induced camera motion. One precise way to do it would be with an array of, say, 32x32 LEDs where each one is turned on sequentially for, say, 100us, at intervals of 500us. This would allow capture of xy coordinate changes over half a second. It would be an easy way to measure camera motion blur for a specific lens, camera, tripod combo.  Would also be useful to characterize the response of lens image stabilization.

Arrays of LEDs are available dirt cheap as are driver electronics. It would be great to see this added to camera and lens evaluations.

https://learn.adafruit.com/connecting-a-16x32-rgb-led-matrix-panel-to-a-raspberry-pi

This is such a wonderful time we live in. Exploration tools are incredible.

Indeed.

As for the camera shake/motion detection, I was thinking in the direction that Jim Kasson did with shooting images of an oscilloscope. I'm writing a Web application that allows to calibrate the display dimensions in order to allow comparisons between cameras and eliminate variables due to focal length and shooting distance. It then displays a (or several) flying-dot(s) which allows to add a time component to the blur.

I'm currently experimenting with SVG vector images (example attached, just open the image with a browser), which should work on modern (HTML5) browsers. I'm experiencing some temporal delays when the computer gets very busy, but other than that the approach seems flexible enough to change the dot size in accordance with the magnification factor (from shooting distance and focal length) to produce a bright and small/accurate dot on the sensor. It's also simple to change the direction/angle of travel, so it be comes possible to sample at two or more angles at the same time.

Cheers,
Bart
Logged
== If you do what you did, you'll get what you got. ==

Doug Gray

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2197
Re: Printer induced Moire
« Reply #8 on: March 26, 2016, 12:14:01 pm »

Bart,

Yes, the work Jim Kasson did with an scope is the best I've seen so far. I believe the array of LEDs would be the simplest and am rather pleased that the hardware is available so inexpensively. Defocussing so that each LED produces a spot about 3 pixels wide should eliminate aliasing since there are effectively no frequencies above Nyquist. Then the math to determine the spot center should be simple and the accuracy probably on the order of a tenth pixels spacing but it has the advantage that where the imager pixels are located relative to the spot becomes irrelevant.  This should yield precise xy coordinates of position shift at intervals of .0005 secs. and completely characterize the function of motion. I'm pretty sure the driver card would have to be programmed at the OS driver level - probably in C. The stuff the cards come with is not designed for real time operation but some of it is open source. Some of that would be tricky.


EtoA:

Looks like it should be pretty easy. Here's a Github project that uses the different color LEDs and PWMs them to render color. The LEDs are either full on or full off and are clocked at up to 10 MHz. Adapting this for a motion test setup should be fairly simple.

https://github.com/Boomerific/rpi-rgb-led-matrix/blob/ee5fe742ea1740e3f8c075ffd62be0c01ebd50e0/README.md




Doug
« Last Edit: March 26, 2016, 02:07:41 pm by Doug Gray »
Logged
Pages: [1]   Go Up