Guest User

Untitled

a guest
Nov 20th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. rawtoppm -rgb 100 200 input.rgb > image.ppm
  2. ppmtorgb3 image.ppm
  3.  
  4. tail +4 image.red > image_r.raw
  5. tail +4 image.grn > image_g.raw
  6. tail +4 image.blu > image_b.raw
  7.  
  8. pgmtoppm red image.red > image_red.ppm
  9. pgmtoppm green image.grn > image_grn.ppm
  10. pgmtoppm blue image.blu > image_blue.ppm
  11.  
  12. for ch in R G B; do
  13. convert -set colorspace RGB -size 100x200 -depth 8 rgb:image.rgb
  14. -channel ${ch} -separate -depth 8 gray:image_${ch}.raw
  15. done
  16.  
  17. convert ... -channel RGB -separate gray:image_%d.raw
  18.  
  19. # colorspace changes mean this works differently after ImageMagick-6.7.6
  20. convert -size 100x200 -depth 8 rgb:image.rgb
  21. -channel ${ch} -separate -depth 8 gray:image_${ch}.raw
  22.  
  23. command /opt/ast/bin/cut -r3 -Nb1 < file > red
  24. command /opt/ast/bin/cut -r3 -Nb2 < file > green
  25. command /opt/ast/bin/cut -r3 -Nb3 < file > blue
  26.  
  27. perl -F -ane '
  28. BEGIN{
  29. $/=3;
  30. map {open $f[$n++], ">", $_} qw{red green blue}
  31. }
  32. for $i (0..2) {print {$f[$i]} $F[$i]}'
  33.  
  34. od -vAn -tu1 < file |
  35. tr -cs 0-9 '[n*]' |
  36. grep . |
  37. paste - - - |
  38. awk '{printf "%c", $1 > "red"
  39. printf "%c", $2 > "green"
  40. printf "%c", $3 > "blue"}'
  41.  
  42. size=$(wc -c < file)
  43. convert -size "1x$size" -channel GB -fx 0 rgb:- rgb:- < file > red
  44. # ...and so on for green and blue
Add Comment
Please, Sign In to add comment