0xffff/0xff = 257
0x10000/0x100=256
Search found 3 matches
- 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: 3188
- 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: 3188
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 ...
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 ...
- 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: 3188
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 ...
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 ...