Pages: [1]   Go Down

Author Topic: Downsizing images and the moiré issue.  (Read 11896 times)

thorir

  • Newbie
  • *
  • Offline Offline
  • Posts: 5
    • http://panografi.com
Downsizing images and the moiré issue.
« on: November 04, 2011, 04:33:11 am »

Hello.

A photographer on another forum, where i was asking the same, suggested I posted this here, so here goes..

I'm new at this forum, so first, a bit of background.
I've been working as a freelance photographer shooting real estate for some years, and lately I've been taking on some assignments for architects. Coming from low-end real estate photography, my bag of equipment is less than optimal for higher end assignments, but I need to be able to solve the jobs I do take on as well as possible - with what I currently got. Guess what I'm saying is that the level of fine detail in my images is low, relative to what I suspect is the norm for architectural shooters on this forum.

With that said, here's my problem.

When outputting images for clients, I resize them to their specifications. That is, I both upscale the images for print, and downsize them for internet use. It's particularly the downsizing process that's causing me headaches, because with a number of my subjects so far, there is often plenty fine detail that causes moiré artifacts when downsized to a resolution that doesn't resolve the detail. Online search found me this, and by tuning this method a little I've come to my best result so far.

I do however, feel like I'm a little busy re-inventing a wheel that must exists already, so what I wanted to ask was if any of you knew a tried and tested method for this issue.

I made a flickr slideshow of four versions of the same image that illustrates the problem, it can be found here.
In "options", if you turn off "embiggen" and choose "slow", and click "show info", then it should be fairly easy to compare the different results while reading a brief description of how the resizing was carried out.

Here is a tighter view of the facade (also with its problems)

Would greatly appreciate all input.

Regards.
Thorir Vidar
(panografi.com)
« Last Edit: November 04, 2011, 04:51:43 am by thorir »
Logged

Bart_van_der_Wolf

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 8914
Re: Downsizing images and the moiré issue.
« Reply #1 on: November 04, 2011, 06:19:00 am »

When outputting images for clients, I resize them to their specifications. That is, I both upscale the images for print, and downsize them for internet use. It's particularly the downsizing process that's causing me headaches, because with a number of my subjects so far, there is often plenty fine detail that causes moiré artifacts when downsized to a resolution that doesn't resolve the detail. Online search found me this, and by tuning this method a little I've come to my best result so far.

I do however, feel like I'm a little busy re-inventing a wheel that must exists already, so what I wanted to ask was if any of you knew a tried and tested method for this issue.

Hi Thorir,

The solution is called Lanczos windowed Sinc resampling, or just Lanczos for short. Some applications offer that as a default for downsampling, Photoshop (if that's what you're using) doesn't.

I've put together a webpage with some different downsampling methods, and the results that can be expected with the most sensitive subjects. When you can avoid trouble with the test target you can download from that page, you will not have problems with less demanding subjects.

The benefit of using ImageMagick is that it also allows to adjust the gamma value at which the resampling takes place, which can matter (as outlined on this webpage). It also allows to do the downsampling in batch, it just takes a few additional Operating System commandline keywords.

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

thorir

  • Newbie
  • *
  • Offline Offline
  • Posts: 5
    • http://panografi.com
Re: Downsizing images and the moiré issue.
« Reply #2 on: November 04, 2011, 03:48:24 pm »

Thanks very much for your reply Bart, I see it's study time at my house  : )

I am indeed using Photoshop for much of my editing process, including resizing and output. It seems I may have to re-evaluate that, at least for some subjects. I compared the output from PS to Lightroom, and LR didn't have the same moiré issues.

If I may ask you one more question, do you happen to know which applications use the Lanczos resampling, or where I might find a list of them.

Now it's best I read your page a few times, until I understand it properly : )


Thanks again.

Thorir
Logged

Bart_van_der_Wolf

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 8914
Re: Downsizing images and the moiré issue.
« Reply #3 on: November 04, 2011, 04:34:36 pm »

Thanks very much for your reply Bart, I see it's study time at my house  : )

I am indeed using Photoshop for much of my editing process, including resizing and output. It seems I may have to re-evaluate that, at least for some subjects. I compared the output from PS to Lightroom, and LR didn't have the same moiré issues.

The current version of Lightroom does a decent job, but not quite as good as Lanczos.

Quote
If I may ask you one more question, do you happen to know which applications use the Lanczos resampling, or where I might find a list of them.

Unfortunately it often is not specified, unless there is a choice of algorithms listed by name. I do know that ImageMagick uses it for downsampling, and a batch resizer like 'RIOT', and Irfanview also does. Of those, only ImageMagick will handle embedded colorspaces and can be instructed to do resampling in linear gamma space.

Cheers,
Bart
« Last Edit: November 04, 2011, 07:22:48 pm by BartvanderWolf »
Logged
== If you do what you did, you'll get what you got. ==

ejmartin

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 575
Re: Downsizing images and the moiré issue.
« Reply #4 on: November 04, 2011, 05:59:06 pm »

RawTherapee is a raw converter that has Lanczos as one of its resize for output options.  (Unfortunately at the moment it doesn't have post-resize sharpening; the resize currently sits after the sharpening module in the image pipeline.) 
Logged
emil

Bart_van_der_Wolf

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 8914
Re: Downsizing images and the moiré issue.
« Reply #5 on: November 04, 2011, 07:30:40 pm »

RawTherapee is a raw converter that has Lanczos as one of its resize for output options.  (Unfortunately at the moment it doesn't have post-resize sharpening; the resize currently sits after the sharpening module in the image pipeline.) 

Hi Emil,

Thanks for that info. That means that Mac folk can also benefit from the Lanczos windowed downsampling. ImageMagick is also available for Mac, but I don't know how easy it is to install/operate. RawTherapee has a GUI that'll make it easy to use, even if one just reads a TIFF or JPEG as input, instead of doing a full Raw conversion.

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

joofa

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 544
Re: Downsizing images and the moiré issue.
« Reply #6 on: November 04, 2011, 07:46:01 pm »

ImageMagick is also available for Mac, but I don't know how easy it is to install/operate.

Yes, it is easy, especially if one is accustomed to the Terminal prompt on Mac.

Quote
RawTherapee has a GUI that'll make it easy to use, even if one just reads a TIFF or JPEG as input, instead of doing a full Raw conversion.

You can also try Photivo (http://photivo.org/photivo/start), which is freely available for Windows, Mac, and Linux. It is more stable than RawTherapee. Rawtherappe crashes quite often. Photivo offers similar (same??) functionality as RawTherappe, and its GUI is more modern than RawTherapee. You might try both and see which one you like more.

Sincerely,

Joofa
Logged
Joofa
http://www.djjoofa.com
Download Photoshop and After Effects plugins

joofa

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 544
Re: Downsizing images and the moiré issue.
« Reply #7 on: November 04, 2011, 08:13:52 pm »

The solution is called Lanczos windowed Sinc resampling, or just Lanczos for short.

Just FYI, technically, for image sensors, the optimal method is not sinc, but a variant of it, as given by the diagram below:



Sinc, and those derived from it, such as Lanczos, are an approximation to the optimal, shown in red above, and suffice in most situations.

I compared the output from PS to Lightroom, and LR didn't have the same moiré issues.

My understanding is that PS uses Bi-Cubic and its variants for downsampling, which is not recommended for a large downsampling ratio. That is why one would use heuristics such as "pre-filter" before downsampling by Bi-Cubic. A proper downsampling kernel, say Lanczos does not need external prefiltering, as prefiltering is built into the downsampling operation. I have read that LR uses better methods, such as Lanczos, and may be that is why you found LR output better than PS.

Joofa
« Last Edit: November 05, 2011, 01:08:21 am by joofa »
Logged
Joofa
http://www.djjoofa.com
Download Photoshop and After Effects plugins

Wayne Fox

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 4237
    • waynefox.com
Re: Downsizing images and the moiré issue.
« Reply #8 on: November 04, 2011, 10:49:54 pm »

I've found some web actions by Jack Flesher do a really nice job.  The concept is pretty simple, the first down sample is minor at gets the image to a resolution that is then downrezzed in exact 50% increments, mixing some versions of bicubic and bicubic sharper.  This maximizes the quality of the bicubic method. You can find out more about there at

http://forum.getdpi.com/forum/showthread.php?t=398

Results are far better than a simple PS downrez.  If the final resolutions aren't what you want, it's pretty easy to make a copy of the actions and then change the sizes to achieve a different final size.

I've built a full set of PS droplets that are based on Jack's actions which also add signatures and border graphics to achieve the final web image.  If you want to see some of the final results, I've got some images in galleries[/url.  All the images are done directly from Lightroom which uses a PS droplet to downrez and apply graphics.
Logged

hjulenissen

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2051
Re: Downsizing images and the moiré issue.
« Reply #9 on: November 05, 2011, 06:21:43 am »

Just FYI, technically, for image sensors, the optimal method is not sinc, but a variant of it, as given by the diagram below:



Sinc, and those derived from it, such as Lanczos, are an approximation to the optimal, shown in red above, and suffice in most situations.
"Optimal" in what way? As in "gives best scores when a set of viewers do a subjective test for a given set of source images"? From sampling theory, a non-windowed sinc function might seem ideal (brick-wall filter in the frequency domain), but I believe that it is not really suited for this problem. From the discussions on AA-filter-less MF cameras, one might believe that nearest neighbor resampling or small-kernel rectangular filtering is preferred by photographers.

In short: how do you weight the benefit of a wide, flat passband vs the drawback of aliasing/imaging in the stop-band? How do you factor in the natural scenes/optics tend to have a high-frequency fall-off (meaning that the input is highly non-flat)? How do you adapt to differing sensor fillfactor/microlenses/aa-filters? How do you factor in that (e.g.) 48dB below signal at low frequencies, humans might not be able to perceive much?

It seems that your red curve has a flatter windowing than the blue curve. That will give predictable pros and cons. Lanczos is often mentioned as a sensible compromise, not as an closed-form solution to this problem. You could try gaussians, B-splines, etc. For lower orders, several theoretic formulas leads to the same numerical solutions.

The "optimal" image resampling filter probably is non-separable, non-linear, input-adaptive and database-driven. I don't think a (working) such thing has been invented yet, and therefore I am sceptical about any resampling claiming to be "optimal".

The problem with moire usually is that the resampling kernel is not smoothing enough - you need an effectively "wider" kernel. Your worst choice would then be nearest neighbor or compact kernels like bilinear (triangular). If your image processing software does not offer flexibility in choice of resampling, you might be able to reduce aliasing/imaging problems by doing a lowpass prefilter.

Filters for Common Resampling Tasks (1990) - Ken Turkowski, Apple Computer


Sampling - 60 years after Shannon (2009) - M. Unser, Fellow, IEEE


(I am not claiming to understand most of the last link, but I believe that it is relevant)

-h
« Last Edit: November 05, 2011, 06:52:31 am by hjulenissen »
Logged

Graham Mitchell

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2281
Re: Downsizing images and the moiré issue.
« Reply #10 on: November 05, 2011, 07:00:23 am »

I've had this issue in the past but solved it by resizing in smaller steps, e.g. halving resolution each time rather than jumping straight to final resolution.
Logged

sniper

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 670
Re: Downsizing images and the moiré issue.
« Reply #11 on: November 05, 2011, 12:49:29 pm »

Another resizer that uses lanczos is Benvista photo zoom, don't know if it's available for Mac though.
Logged

joofa

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 544
Re: Downsizing images and the moiré issue.
« Reply #12 on: November 05, 2011, 01:09:36 pm »

"Optimal" in what way?

Approximation to original signal.

I've had this issue in the past but solved it by resizing in smaller steps, e.g. halving resolution each time rather than jumping straight to final resolution.

Yes, that does the trick in a different way, as far as suppressing aliasing is concerned. But, please keep in mind that the resulting "overall" filtering operation may be different than the direct application of a given filter to jump directly to the final resolution.

Please see this link:

http://www.luminous-landscape.com/forum/index.php?topic=40687.msg339373#msg339373

Sincerely,

Joofa
« Last Edit: November 05, 2011, 01:12:34 pm by joofa »
Logged
Joofa
http://www.djjoofa.com
Download Photoshop and After Effects plugins

thorir

  • Newbie
  • *
  • Offline Offline
  • Posts: 5
    • http://panografi.com
Re: Downsizing images and the moiré issue.
« Reply #13 on: November 05, 2011, 01:26:41 pm »

Not too far into this thread I was already falling short regarding understanding of the techniques discussed. Not to mention that the terminal window scares me.. (running a mac, 10.5, cs3 fwiw)
If you keep the discussion going, I might keep quiet in the back, watcing and listening and trying to adapt the techniques that aren't way over my head. Got work to do in that respect already. Or even, at some point, have a go at the dreaded terminal window : )

Nevertheless, I greatly appreciate the input.
Many thanks everyone

Thorir
Logged

hjulenissen

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2051
Re: Downsizing images and the moiré issue.
« Reply #14 on: November 05, 2011, 03:20:58 pm »

Approximation to original signal.
Would you care to elaborate on that?

-k
« Last Edit: November 05, 2011, 03:28:41 pm by hjulenissen »
Logged

RFPhotography

  • Guest
Re: Downsizing images and the moiré issue.
« Reply #15 on: November 05, 2011, 03:55:05 pm »

Not too far into this thread I was already falling short regarding understanding of the techniques discussed. Not to mention that the terminal window scares me.. (running a mac, 10.5, cs3 fwiw)
If you keep the discussion going, I might keep quiet in the back, watcing and listening and trying to adapt the techniques that aren't way over my head. Got work to do in that respect already. Or even, at some point, have a go at the dreaded terminal window : )

Nevertheless, I greatly appreciate the input.
Many thanks everyone

Thorir

Welcome to measurebator central.  It's really not uncommon for topics to go off on tangents when the measurebators get involved and start tossing around equations and arguing about 10th decimal accuracy.   ::)
Logged

David Eichler

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 826
    • San Francisco Architectural and Interior Photographer
Re: Downsizing images and the moiré issue.
« Reply #16 on: February 04, 2012, 03:15:16 am »

Well, i seem to have found the mother of all downsizing-moire problems, a Sub-Zero fridge grill. Tried preblurring and Photozoom with Lanczos and BSpline. Nothing works. What now?
Logged

ErikKaffehr

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 11311
    • Echophoto
Re: Downsizing images and the moiré issue.
« Reply #17 on: February 04, 2012, 03:48:06 am »

Hi,

My experience may be that Lightroom has a better downscaling algorithm than Photoshop. Personally, I either use Lightroom or "Image Magick" for downscaling. Image Magick is free software. http://www.imagemagick.org/

This article links to some good info:  http://echophoto.dnsalias.net/ekr/index.php/photoarticles/62-scaling-up-or-down

Best regards
Erik

Hello.

A photographer on another forum, where i was asking the same, suggested I posted this here, so here goes..

I'm new at this forum, so first, a bit of background.
I've been working as a freelance photographer shooting real estate for some years, and lately I've been taking on some assignments for architects. Coming from low-end real estate photography, my bag of equipment is less than optimal for higher end assignments, but I need to be able to solve the jobs I do take on as well as possible - with what I currently got. Guess what I'm saying is that the level of fine detail in my images is low, relative to what I suspect is the norm for architectural shooters on this forum.

With that said, here's my problem.

When outputting images for clients, I resize them to their specifications. That is, I both upscale the images for print, and downsize them for internet use. It's particularly the downsizing process that's causing me headaches, because with a number of my subjects so far, there is often plenty fine detail that causes moiré artifacts when downsized to a resolution that doesn't resolve the detail. Online search found me this, and by tuning this method a little I've come to my best result so far.

I do however, feel like I'm a little busy re-inventing a wheel that must exists already, so what I wanted to ask was if any of you knew a tried and tested method for this issue.

I made a flickr slideshow of four versions of the same image that illustrates the problem, it can be found here.
In "options", if you turn off "embiggen" and choose "slow", and click "show info", then it should be fairly easy to compare the different results while reading a brief description of how the resizing was carried out.

Here is a tighter view of the facade (also with its problems)

Would greatly appreciate all input.

Regards.
Thorir Vidar
(panografi.com)
Logged
Erik Kaffehr
 
Pages: [1]   Go Up