Select to view content in your preferred language

Rotate raster by 90 degrees without resample

601
2
11-25-2010 04:25 AM
DavidDonnelly
Deactivated User
I have ~100 large (typically 20,000 * 24,000 pixels) TIFF images which are archival scans of our maps. Unfortunately due to the size of the maps most of them are the wrong rotation. I would like to rotate each map by 90 or 270 degrees (they vary!) while retaining all of the original detail. I've tried rotating using nearest neighbour and majority sampling and they lose a lot of detail. Cubic convolution is better, but I'm really looking for a pixel transposition, not a resampling. I want the first row of pixels in the input image to become the last row in the output iimage, the second input row becomes the second last column etc.

Does anyone know a means of doing this? At a later date I will probably georeference the maps, but at present I just want to create an archival copy at the correct orientation.

Thanks in anticipation,


David.
0 Kudos
2 Replies
V_StuartFoote
MVP Frequent Contributor
David,

Probably best to do it outside of ArcGIS.  If the TIFF format output of your scanner was Exif compliant, true for most newer scanners, you should be able to rotate the images by editing the Exif orientation & issuing rotate/flip--a lot of applets (including the scanner controls) to do this with. By nature this will be lossless--90, 180, 270 degrees.

But, if you need additional touch-up of the scanned maps while rotating--use open source GIMP or Adobe PhotoShop.  Note that any rotation other than 90, 180, or 270 will "resample" the pixels.  The 64-bit versions of programs will allow you to handle larger TIFF images.

You should be able to script the rotations. GIMP provides the Script-Fu macro language or GIMP-Python with an extension. PhotoShop has Actions macros or scripting with JavaScript or Python (w/the Photoshop.Application COM server)

Of course when you bring the reoriented TIFFs into ArcMAP, to do any useful work when you georeference you will be transforming and resampling anyhow. But if you work in the same projection an AFINE transform with just 3 control points will give you good registration with simplest pixel rotation and scaling.

Stuart
0 Kudos
DavidDonnelly
Deactivated User
Stuart,

Thanks very much for your post, that's very helpful. Unfortunately we don't have access to the original output of the scanner - it was contracted out. I'll definitely take a look at GIMP and Script-Fu.

Thanks again,



David.
0 Kudos