Does exist any way to convert TIFF image from little-endian byte order to big-endian?

2.3k Views Asked by At

I have .dll library which use tiff image in big-endian (MM) byte order, but image scanner create image in little-endian (II) byte order.

How to convert tiff from little-endian (II) to big-endian (MM)?

Will be great, watch how it make in java

2

There are 2 best solutions below

1
On BEST ANSWER

You can do that with ImageMagick like this:

convert image.tif -define tiff:endian=msb msb.tif

Here is the before image with Intel byte ordering (II):

xxd image.tif| more
0000000: 4949 2a00 0800 0600 ffff 0000 0000 ffff  II*.............

And here is the after image with Motorola ordering (MM):

xxd msb.tif| more
0000000: 4d4d 002a 0006 0008 ffff 0000 0000 ffff  MM.*............
0
On

The ImageMagick package's convert tool seems to be able to do this. The command line would be something like:

convert myllfile.tiff -endian MSB mymmfile.tiff