views:

159

answers:

2

How can I reduce moire effects when downsampling halftone comic book images during live zoom on an iPhone or iPad?

I am writing a comic book viewer. It would be nice to provide higher resolution images and allow the user to zoom in while reading the comic book. However, my client is averse to moire effects and will not allow this feature if there are noticeable moire artifacts while zooming, which of course there are.

Modifying the images to be less susceptible to moire would only work if the modifications were not perceptible. Blur was specifically prohibited, as is anything that removes the beloved halftone dots.

The images are black and white halftone and line art. The originals are 600 dpi but what we ship with the application will be half that at best, so probably 2500 pixels or less tall.

So what are my options? If I write a custom downsampling algorithm would it be fast enough for real time on these devices? Are there other tricks I can do? Would it work to just avoid the size ratios that have the most visual moire effects?

As you zoom in an out, there are definitely peaks where the moire effects are worst. Is there a way to calculate what those points are and just zoom to a nearby scale that is not as bad?

Any suggestions are welcome. I have very little experience with image and signal processing, but am enjoying the opportunity to learn. I know nothing of wavelets and acutance and other jargon, so please be verbose.

Edit:

For now at least we are punting on dynamic zoom. We will support zooming in to full magnification but not arbitrary scaling. I hope to revisit this in the future.

+2  A: 

Moire effects occur due to aliasing. Aliasing occurs due to the sampling frequency being too low compared to the frequency content of the signal/image.

I can't really see any way to avoid this without applying blur. If you choose your blur filter good enough you should be able to get results which do not look "blurred" at all.

Since blur is simple to implement I would implement downsampling with blurring and show it to the customer. If they are happy with the results, then all should be well.

The only other options I see is:

  1. Custom downsampling method. Unless someone else has come up with one, I don't think it's an option, since you yourself claim to have little experience with image/signal processing.

  2. Convert the comics to vector format which would yield infinite zoom.

kigurai
Conditional blur and vector graphics are both good options.
drawnonward
In the future, if I get more time to work on this, I will try the blur scaling. Distributing vector artwork was unfortunately not an option.
drawnonward
+1  A: 

Difficult problem, in general, interesting in particular. I doubt there is a good-simple solution - perhaps if we could assume a nearly ideal halftoning (monochrome images with halftoning dots placed in a perfect grid), but this would hardly work for a scanned image.

If you are interested in the math and/or want some bibliography to research, this thesis might be useful (i haven't read it)

Also you can search for descreening algorithms, plugins, etc, to get ideas.

leonbloy
I think you can assume monochrome images with ideal halftoning. These do not look like scanned images.
drawnonward
The spacing is identical throughout, but grids in different fill regions are not aligned.
drawnonward
Well, if the spacing is perfecly identical (and perfectly aligned with the axis - this only makes sense if the halftoning was digitally done) a resampling with a distance equal to the dots separation (or a multiple) should suffice.
leonbloy
I chose this because the solution we are going with is basically forcing even multiples.
drawnonward