Search found 3 matches

by Hiro
2018-03-01T08:17:46-07:00
Forum: Users
Topic: converting a 16-bit PPM file to two 8-bit PPM files
Replies: 4
Views: 2882

Re: converting a 16-bit PPM file to two 8-bit PPM files

0xffff/0xff = 257
0x10000/0x100=256
by Hiro
2018-02-28T08:56:08-07:00
Forum: Users
Topic: converting a 16-bit PPM file to two 8-bit PPM files
Replies: 4
Views: 2882

Re: converting a 16-bit PPM file to two 8-bit PPM files

Thank you for your quick reply. bash$ echo "P3 1 1 65535 64192 64192 64192" | convert - -evaluate And 255 -evaluate Multiply 257 -depth 8 -compress None PPM:-|tohex 0 1 1 ff c0 c0 c0 bash$ echo "P3 1 1 65535 64192 64192 64192" | convert - -evaluate RightShift 8 -evaluate And 255 -evaluate Multiply ...
by Hiro
2018-02-28T08:20:01-07:00
Forum: Users
Topic: converting a 16-bit PPM file to two 8-bit PPM files
Replies: 4
Views: 2882

converting a 16-bit PPM file to two 8-bit PPM files

Hi, I'd like to convert a 16-bit PPM file to two 8-bit PPM files, one is from MSB 8bits and the other from LSB 8bits. In the following example I use a bash function, tohex(), which convert decimal numbers into hexadecimal numbers. bash$ type tohex tohex is a function tohex () { perl -nae 'print join ...