Friday, February 10, 2012

Working Around Those Terrible Lines in High Resolution Photos

I'm sure everyone knows what we're talking about. Those terrible horizontal and vertical lines in our high resolution photos.

There is a JIRA posted on this bug (SH-2378) with some great work by people like Dil Spitz who narrowed the problem down to various things it is and is not and when the bug was introduced. The bug entered the code in Viewer 3.2.4 timeframe (Nov 23'11) (as of Feb 10, the main Linden viewer is 3.2.44). The code that seemed to introduce the bug was part of some frame rate improvements and has been around since. Speculations that it was either a problem with anti-aliasing or the Nvidia driver turned out to be not true.

From what the community can reverse engineer, when you take a high resolution photo it takes several passes at your screen resolution and then "stitches" the image together the way you might stitch together a panorama. There are several problems with this. 1) There appears to be a goof in the stitching, leaving a 1px or 2px artifact between the stitches both vertically and horizontally. 2) What ever wall clock time passes between various stitch captures. Just like RL this means each stitch frame is slightly further in time. This makes taking shots with fast moving water reflections, fast moving clouds, or rotating stage lights impossible.

I typically shoot "high resolution" with crtl-~ which means there are 4 frames total that are stitched together leaving a single vertical and horizontal line that goes through the center of the screen. If you shoot highest resolution at 6000px plus you will end up with multiple stitchlines.

It dawned on me this morning that a simple tool that would just either surgically remove those two pixels or even better just stretch each quadrant by 1px would work very very well! But what tool? About 30 seconds later it came to me, duhhhh photoshop!

Using photoshop actions is a simple way to record various keystroke sequences into an action and then assigning it to a keystroke. With a bit of experimenting I came up with a simple photoshop action that when I press SHIFT-F2 it moves the artifact. Photoshop actions are also cool in that you can run them in "batch" mode and have them fix an entire folder of pictures in one request.

Take a look at the result

The raw camera shot with the artifact lines

After running the fixit script

Now this is by no means better than fixing the problem. But I suspsect you'll agree, this is significnatly better in most cases than doing clone stamping or blur.

Before (zoomed in)

After zoomed in:

Good enough!!

I wrote the action "script" with my older copy of Photoshop CS2 so it should work on CS3, 4, 5, etc.

Now the caveat. I'm using a 37" 1080p HD TV as primary SL monitor and so my crtl-~ shots are 3840 x 2036 px. I can't say how many people are shooting at that resolution, but i suspect not that many. The script is unfortunately hardwired to that resolution. It won't work if the catpure is at a different resolution. You'll have to start with what i came up with and modify or redo it. I have no clue if this works in Aperture, Photoshop Elements, GIMP, etc.

Download the Photoshop action to your computer here. (go to file menu and select download. you might need to get a google+ account, not sure) Save it where ever.

Check out the demo and learn now to install the action. (best to watch in HD full screen)

I'm opening this post for comments.


  1. Tried to download the action this is the message I got

    Sorry, the page (or document) you have requested is not available.

    Please check the address and try again.

  2. I'll give him a shake and have him fix that download today! Sorry! Be sure to check back.

  3. sorry guys i goofed and forgot to hit the share button in google docs. Let me now if it works now.

  4. also i've been testing the 3.3.0 firestorm. Linc reports its fixed. So far early testing suggests he might be right. Stay tuned.

  5. Pesky lines just showed up again in 3.3...BOO!

    I also downloaded the action, took a shot at the above resolution, applied the action - but nothing happened. Partially, I suspect because when I look at the action, the selection area is in inches, not pixels.

    I realize there's no support, but the demo just shows us the magic, not the steps, so it's hard to emulate.

    Thanks so much for all the research Stefan! I'm off to go grow some hair so I can pull it out.

  6. I surrender. I have gone back to Firestorm - High Res Shots at 5500 x 3234 with no grid lines

    1. Or so I about over a barrel. has no lines, but requires 2 year old nVidia drivers to run. runs under the new drivers, but has the damn lines.

      I am seriously thinking about stripping....

  7. someone else posed another approach at

    the action i made is very specific to both my screen resolution and my shoot resolution. i'll need to look at the action to adjust. BTW the action always uses inches rather than pixels. I wish i knew how to change that.