imagemagick - Does anyone know how to convert to little endian .pfm file from ImageMagic? -
i'm looking method convert little endian.pfm file imagemagick.
as know can pfm file this.
convert input.bmp output.pfm
this output file made big endian. want convert little endian.
so there method convert little endian big endian on imagemagick?
thanks
endian can controlled -endian option.
example. create 2x2 red pfm image little endian, , write hexdump
.
$ convert -size 2x2 xc:red -endian lsb pfm:- | hexdump 0000000 50 46 0a 32 20 32 0a 2d 31 2e 30 0a 00 00 80 3f 0000010 00 00 00 00 00 00 00 00 00 00 80 3f 00 00 00 00 0000020 00 00 00 00 00 00 80 3f 00 00 00 00 00 00 00 00 0000030 00 00 80 3f 00 00 00 00 00 00 00 00 000003c
you can confirm little endian translating header.
50 46 0a 32 20 32 0a 2d 31 2e 30 0a 00 00 80 3f | | | | little endian -------| "-1.0" | | lsm data|
repeat above big endian.
$ convert -size 2x2 xc:red -endian msb pfm:- | hexdump 0000000 50 46 0a 32 20 32 0a 31 2e 30 0a 3f 80 00 00 00 0000010 00 00 00 00 00 00 00 3f 80 00 00 00 00 00 00 00 0000020 00 00 00 3f 80 00 00 00 00 00 00 00 00 00 00 3f 0000030 80 00 00 00 00 00 00 00 00 00 00 000003b
and observe...
50 46 0a 32 20 32 0a 31 2e 30 0a 3f 80 00 00 00 | | | | big endian ----------| "1.0"| | msb data|
Comments
Post a Comment