カメラは何千万画素とスペックを競うが、このスペックと画像の関係も見渡しながらデジタル画像に触れてみる
addons/labs/labs/examples/data/toucan.bmp addons/labs/labs/examples/data/toucan.png
require 'viewmat bmp png' NB. J805 require 'viewmat bmp ' NB. J602
a0=. readbmp 'c:/temp/toucan.bmp' $ a 144 200 */ $ a0 28800 viewmat a0
viewrgb readbmp 'c:/temp/toucan.bmp'
viewmat readbmp 'c:/temp/toucan.bmp'
viewpng 'c:/temp/toucan.png'
viewpng 'c:/temp/toucan.bmp'
2 #. 1 1 1 7 16 #. 1 1 1 273 16 16 16 #: 273 1 1 1
_10{. _10{."1 a0 16718116 16718116 16718116 16718116 16718116 16719144 16721200 15598092 6952454 0 16718116 16718116 16718116 16719144 16721200 16649497 9504006 1389569 485632 0 16719144 16720172 16722228 16718374 10683141 2373889 546048 486656 486656 0 16649497 16449801 11535625 5186308 546048 486656 486656 486656 486656 0 3809794 1389569 613889 486656 486656 486656 486656 486656 486656 0 485632 486656 486656 486656 486656 486656 486656 486656 486656 0 486656 486656 486656 486656 486656 486656 486656 486656 486656 0 486656 486656 486656 486656 486656 486656 486656 486656 486656 0 486656 486656 486656 486656 486656 486656 486656 486656 486656 0 0 0 0 0 0 0 0 0 0 0
256 256 256 #: 16718116 255 25 36
256 256 256 #: L:0 {@> _10{. _10{."1 a0 +---------+---------+---------+---------+---------+---------+---------+--------+--------+-----+ |255 25 36|255 25 36|255 25 36|255 25 36|255 25 36|255 29 40|255 37 48|238 2 12|106 22 6|0 0 0| +---------+---------+---------+---------+---------+---------+---------+--------+--------+-----+ |255 25 36|255 25 36|255 25 36|255 29 40|255 37 48|254 13 25|145 5 6 |21 52 1 |7 105 0 |0 0 0| +---------+---------+---------+---------+---------+---------+---------+--------+--------+-----+ |255 29 40|255 33 44|255 41 52|255 26 38|163 3 5 |36 57 1 |8 85 0 |7 109 0 |7 109 0 |0 0 0| +---------+---------+---------+---------+---------+---------+---------+--------+--------+-----+ |254 13 25|251 1 9 |176 5 9 |79 35 4 |8 85 0 |7 109 0 |7 109 0 |7 109 0 |7 109 0 |0 0 0| +---------+---------+---------+---------+---------+---------+---------+--------+--------+-----+ |58 34 2 |21 52 1 |9 94 1 |7 109 0 |7 109 0 |7 109 0 |7 109 0 |7 109 0 |7 109 0 |0 0 0| +---------+---------+---------+---------+---------+---------+---------+--------+--------+-----+ |7 105 0 |7 109 0 |7 109 0 |7 109 0 |7 109 0 |7 109 0 |7 109 0 |7 109 0 |7 109 0 |0 0 0| +---------+---------+---------+---------+---------+---------+---------+--------+--------+-----+ |7 109 0 |7 109 0 |7 109 0 |7 109 0 |7 109 0 |7 109 0 |7 109 0 |7 109 0 |7 109 0 |0 0 0| +---------+---------+---------+---------+---------+---------+---------+--------+--------+-----+ |7 109 0 |7 109 0 |7 109 0 |7 109 0 |7 109 0 |7 109 0 |7 109 0 |7 109 0 |7 109 0 |0 0 0| +---------+---------+---------+---------+---------+---------+---------+--------+--------+-----+ |7 109 0 |7 109 0 |7 109 0 |7 109 0 |7 109 0 |7 109 0 |7 109 0 |7 109 0 |7 109 0 |0 0 0| +---------+---------+---------+---------+---------+---------+---------+--------+--------+-----+ |0 0 0 |0 0 0 |0 0 0 |0 0 0 |0 0 0 |0 0 0 |0 0 0 |0 0 0 |0 0 0 |0 0 0| +---------+---------+---------+---------+---------+---------+---------+--------+--------+-----+
整数 | 多色のメッシュ | RGB256色で1600万色 |
バイナリー | 2色の格子 | |
複素数 | 矢印 | 矢印でベクトルを表示 |
sier0=: 3 : 0 NB. sierpinsky gasketto NB. u y (e.g. 3;256)(7;712) 'NR SIZE'=: y Y0=: NR. ^:_1 i. SIZE viewmat Y0 +./ . *. |: Y0 )
f7=: +&_0.2j0.8@(^&3) NB. triple -> add _0.2j0.8\[fx= z^{3}-0.2j0.8\]
escapet=: 2 : 0 NB. Usage: (f5 esc0 4 100 ) 0.3 1 // OK NB. 0.3 1 is initial numbers for julia set 'a0 b0'=: n # TMP=.(,u@{: )^:(<&b0@# *. <&a0@:(+/)@:|@:{: )^:_ ,: y )
viewmat (f7 julia0 4 100) fjx _1.5 512
NB. fx for jullia(mk canvas fjx=: 3 : '|.|: j./ ~ ({. y)+3*(i.%<:) {: y'
viewmat ((+&_0.678j0.312@*:) julia0 4 100) fjx _1.5 512
julia0=: 2 : '>(u escapet n) L:0 {@> y' julia=: 2 : '>(u escapet 4 256) L:0 {@> fjx _1.5 512'
viewmat (f5 julia0 4 100) fjx _1.5 512 NB. J8 OK
viewmat mandelt fmx _2j_1.5 256
0,0 1 0,:0 0 0 0 0 1 0 0 0 0
hp 0,0 1 0,:0 0 0 0 0 0 0 0 1 1 1 1 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 viewmat hp 0,0 1 0,:0
NB. Cris Burke/Aug. 2004 NB. Hilbert curve hp=: 3 : '(|.,]) 1 (0 _2 _2 ,&.> _2 _1 0 + # y) } (,.|:) y' viewmat hp ^: 5 [ 0, 0 1 0 ,: 0
}:"1 fern_rt ^:(i.10) 0.5 0.5 1 0.5 0.5 0.3525 0.229 0.346285 0.35055 0.333711 0.153166 0.25 0.0245066 0.25098 0.180831 0.20318 0.200008 0.188634 0.193233 0.205568 0.326703 0.25 0.0522725
499* }:"1 fern_rt ^:(i.10) 0.5 0.5 1 249.5 249.5 84.83 163.423 97.3549 220.346 110.278 268.23 52.1158 135.522 124.75 21.6835 130.821 27.16 130.997 102.683 134.167 166.871 139.43 221.304
]a=. ,. ;/ roundint 499* }:"1 fern_rt ^:(i.10) 0.5 0.5 1 +-------+ |250 250| +-------+ |125 40 | +-------+ |126 114| +-------+ |156 50 | +-------+ |154 121| +-------+ |99 113 | +-------+
viewndx=: 3 : 'viewmat |.|: 1 (;/roundint 499 * y.) } 500 500$0' NB. ============================== t0=:mp&(4 6 mk_gm 0.16 0.25) t2=: mp&(0 1 3 4 6 7 mk_gm 0.2 0.23 _0.26 0.22 0.2 0.1025) t1=: mp&(0 1 3 4 6 7 mk_gm 0.85 _0.04 0.04 0.85 0.0375 0.17) t3=: mp&(0 1 3 4 6 7 mk_gm _0.15 0.26 0.28 0.24 0.2875 _0.021) fern_rt=: t0`t1`t2`t3 @.(?@9: { 0 1 1 1 1 1 1 2 3"_) NB. ==============run===OK============ run_fern=: 3 : 'viewndx }:"1 fern_rt^:(i.20000) 0.5 0.5 1' roundint <.@:+&0.5