@snibgo
a great solution, 11x faster as my fx operator hack
Code: Select all
$ time convert 1.png -fx 'u/256+int(u*65536)%256)/256' out1.png
real 0m0.876s
$ time convert 1.png \( -clone 0 -evaluate RightShift 8 \) \( -clone 0 -evaluate And 255 -evaluate LeftShift 8 \) -delete 0 -compose Plus -composite out.png
real 0m0.077s
$ time convert 1.png gray:- | convert -depth 16 -endian msb -size 320x240 gray:- out3.png
real 0m0.035s
thanks
-----------------------------------
Exiftool
can't manipulate the PNG binary.
Phil (exiftool) says, it's ImageMagick part to correct the wrong byte sequence
this is a RAW dump from EXIF Header of the FLIR camera
$ exiftool -v3 FLIR0080.jpg | grep -A40 "FLIR Record 0x01"
| FLIR Record 0x01, offset 0x0f24, length 0xcddf
| RawData (SubDirectory) -->
| - Tag 0x0001 (52703 bytes):
| 0f24: 02 00 40 01 f0 00 00 00 00 00 00 00 3f 01 00 00 [..@.........?...]
| 0f34: ef 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [................]
| 0f44: 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 [.PNG........IHDR]
| 0f54: 00 00 01 40 00 00 00 f0 10 00 00 00 00 04 d6 3e [...@...........>]
| 0f64: f4 00 00 20 00 49 44 41 54 78 01 5c dd db af 6d [... .IDATx.\...m]
exiftool export the PNG with same byte sequence
Code: Select all
$ hexdump -C flir-e4-thermal-imaging-camera-teardown.png | head
00000000 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 |.PNG........IHDR|
00000010 00 00 01 40 00 00 00 f0 10 00 00 00 00 04 d6 3e |...@...........>|
00000020 f4 00 00 20 00 49 44 41 54 78 01 5c dd db af 6d |... .IDATx.\...m|
00000030 5b 76 df f5 39 f7 5e fb ec cb b9 94 ab ca 75 af |[v..9.^.......u.|
00000040 54 ca ae 60 c7 c1 94 65 1b 63 43 12 94 c8 41 21 |T..`...e.cC...A!|