## how to visualise an arbitrary size matrix with svg?

Expand Messages
• 2 Queries around the same idea: 1: Is there a simple way to visualise an arbitrary size matrix with svg? ie say: vary opacity or hue, as a gradient over
Message 1 of 3 , Oct 24, 2010
• 0 Attachment
2 Queries around the same idea:

1: Is there a simple way to visualise an arbitrary size matrix with svg?
ie say: vary opacity or hue, as a gradient over another arbitrary size
rectangle.

very basic method: fill in a rectangle for each value in the matrix

one stop 0.24 and another using a 3x3 kernel to give an average value
~0.2575**
and a radius calculated from the scale of the matrix (19x19) to the
displayed size of the graphic

2: is there a way to input colour or alpha values for an image
directly?
as suggested here: "To illustrate, suppose you have a input image
which is 5 pixels by 5 pixels, whose color values for one of the color
channels are as follows:"
http://www.w3.org/TR/SVG/filters.html#feConvolveMatrixElement

Jonathan

**using the value at the second row and second column of the matrix
attached:

0.235 0.233 0.241 0.236 0.197 0.160 0.127 0.121 0.117 0.138
0.142 0.135 0.164 0.170 0.182 0.212 0.206 0.185 0.179
0.251 0.240 0.252 0.248 0.215 0.171 0.121 0.132 0.119 0.141
0.148 0.161 0.174 0.200 0.220 0.230 0.196 0.174 0.169
0.266 0.280 0.302 0.351 0.288 0.237 0.159 0.184 0.200 0.214
0.241 0.255 0.254 0.251 0.302 0.335 0.263 0.189 0.157
0.250 0.251 0.355 0.716 0.379 0.285 0.311 0.283 0.302 0.317
0.357 0.400 0.344 0.316 0.381 0.698 0.320 0.196 0.168
0.201 0.196 0.298 0.375 0.343 0.332 0.369 0.382 0.402 0.421
0.486 0.822 0.432 0.352 0.311 0.302 0.222 0.145 0.133
0.174 0.166 0.235 0.275 0.320 0.390 0.490 0.491 0.495 0.491
0.505 0.511 0.385 0.288 0.239 0.200 0.157 0.090 0.088
0.116 0.114 0.172 0.220 0.275 0.418 0.859 0.607 0.587 0.598
0.528 0.462 0.336 0.244 0.193 0.144 0.088 0.050 0.048
0.077 0.097 0.124 0.181 0.262 0.371 0.520 0.555 0.647 0.940
0.600 0.470 0.307 0.207 0.154 0.100 0.037 0.009 0.013
0.058 0.068 0.107 0.150 0.209 0.299 0.409 0.509 0.655 0.940
0.588 0.380 0.278 0.175 0.139 0.086 0.018 -0.006 -0.015
0.044 0.045 0.085 0.124 0.177 0.232 0.308 0.451 0.576 0.940
0.548 0.388 0.245 0.158 0.088 0.037 0.006 -0.033 -0.036
0.046 0.045 0.071 0.107 0.154 0.201 0.260 0.334 0.445 0.499
0.402 0.289 0.188 0.121 0.049 0.004 -0.018 -0.043 -0.046
0.066 0.047 0.071 0.086 0.131 0.176 0.219 0.293 0.348 0.343
0.294 0.217 0.147 0.072 0.029 -0.003 -0.037 -0.063 -0.057
0.080 0.074 0.094 0.106 0.132 0.147 0.194 0.238 0.280 0.302
0.238 0.148 0.084 0.038 0.004 -0.010 -0.048 -0.058 -0.058
0.088 0.106 0.138 0.161 0.175 0.161 0.189 0.225 0.255 0.242
0.185 0.106 0.037 0.012 -0.011 -0.032 -0.060 -0.051 -0.069
0.144 0.156 0.214 0.292 0.247 0.193 0.184 0.232 0.273 0.302
0.169 0.036 0.018 -0.005 -0.032 -0.047 -0.056 -0.061 -0.065
0.173 0.198 0.299 0.657 0.308 0.234 0.202 0.225 0.306 0.638
0.127 -0.160 -0.032 -0.012 -0.030 -0.049 -0.063 -0.068 -0.063
0.172 0.193 0.257 0.341 0.276 0.231 0.207 0.209 0.230 0.257
0.118 -0.015 -0.023 0.057 -0.020 -0.017 -0.045 -0.057 -0.060
0.164 0.173 0.205 0.242 0.215 0.184 0.166 0.170 0.166 0.168
0.110 0.014 0.007 0.003 -0.014 -0.020 -0.029 -0.055 -0.063
0.161 0.172 0.200 0.227 0.204 0.190 0.173 0.156 0.161 0.161
0.109 0.037 0.022 0.004 0.007 -0.010 -0.036 -0.041 -0.053
• On Sun, 24 Oct 2010 15:15:20 +0200, Jonathan Chetwynd ... Would patterns work? Alteratively, can you use CSS selectors? cheers -- Charles McCathieNevile Opera
Message 2 of 3 , Oct 24, 2010
• 0 Attachment
On Sun, 24 Oct 2010 15:15:20 +0200, Jonathan Chetwynd
<j.chetwynd@...> wrote:

> 2 Queries around the same idea:
>
> 1: Is there a simple way to visualise an arbitrary size matrix with svg?
> ie say: vary opacity or hue, as a gradient over another arbitrary size
> rectangle.

Would patterns work?

Alteratively, can you use CSS selectors?

cheers

--
Charles McCathieNevile Opera Software, Standards Group
je parle français -- hablo español -- jeg lærer norsk
http://my.opera.com/chaals Try Opera: http://www.opera.com
• On Sun, Oct 24, 2010 at 02:15:20PM +0100, Jonathan Chetwynd wrote: . . . ... . . . I know mathematics, and SVG, but I truly don t see the connection you re
Message 3 of 3 , Nov 7 8:35 AM
• 0 Attachment
On Sun, Oct 24, 2010 at 02:15:20PM +0100, Jonathan Chetwynd wrote:
.
.
.
> 2 Queries around the same idea:
>
> 1: Is there a simple way to visualise an arbitrary size matrix with svg?
> ie say: vary opacity or hue, as a gradient over another arbitrary size
> rectangle.
>
> very basic method: fill in a rectangle for each value in the matrix
>
> one stop 0.24 and another using a 3x3 kernel to give an average value
> ~0.2575**
> and a radius calculated from the scale of the matrix (19x19) to the
> displayed size of the graphic
>
>
> 2: is there a way to input colour or alpha values for an image
> directly?
> as suggested here: "To illustrate, suppose you have a input image
> which is 5 pixels by 5 pixels, whose color values for one of the color
> channels are as follows:"
> http://www.w3.org/TR/SVG/filters.html#feConvolveMatrixElement
>
> Jonathan
>
> **using the value at the second row and second column of the matrix
> attached:
.
.
.
I know mathematics, and SVG, but I truly don't see the
connection you're making here. I suspect a lot of it
has to do with "simple way"--no, it's a certainty that
pathologic cases will break any such scheme you propose,
but, yes, if you have information about the matrix that
perhaps is obvious to you, but I don't apprehend, then
useful visualizations are feasible.

I'd love to understand better what you have in mind.
What would it take to make a minimal example of "matrix
visualization" for you?
Your message has been successfully submitted and would be delivered to recipients shortly.