Commit | Line | Data |
---|---|---|
80266d42 TC |
1 | Times are +1000 2001 (day/month) |
2 | 7/5 23:45:19 <Addi:#Imager> If people want something smarter they can just convert to gray themselves. | |
3 | 7/5 23:45:39 (irc.infobot.org) * TonyC:#Imager doesn't even know how to convert to greys in Imager | |
4 | 7/5 23:46:01 <Addi:#Imager> That's what I want to add... | |
5 | 7/5 23:46:03 <Addi:#Imager> But like this: | |
6 | 7/5 23:46:56 <Addi:#Imager> $gray = $img->cspace( matrix=> [[ 0.3 0.3 0.4 ]] ) | |
7 | 7/5 23:47:09 <Addi:#Imager> Or actually | |
8 | 7/5 23:47:12 (irc.infobot.org) <^_TonyC^_:#Imager> $greyimg = $img->convert([10,20,5]); # one channel output from 3 | |
9 | 7/5 23:47:15 <Addi:#Imager> $gray = $img->cspace( matrix=> [[ 0.3 0.3 0.4 0 ]] ) | |
10 | 7/5 23:47:56 <Addi:#Imager> If you have an extra parameter then you can do adds too. | |
11 | 7/5 23:48:09 (irc.infobot.org) <^_TonyC^_:#Imager> $img = $img->convert([10,0,0],[9,0.5,0.5],[10,0,0]); # make it a bit less greener | |
12 | 7/5 23:48:54 <Addi:#Imager> Often you have an imaginary color that is fixed to be 1 | |
13 | 7/5 23:49:09 (irc.infobot.org) <^_TonyC^_:#Imager> that would simplify it | |
14 | 7/5 23:49:10 <Addi:#Imager> So each pixel has the form [r g b 1] | |
15 | 7/5 23:49:15 <Addi:#Imager> or [r g b a 1] | |
16 | 7/5 23:49:23 <Addi:#Imager> Always one more than the image actually has | |
17 | 7/5 23:49:34 <Addi:#Imager> That way you can do like for grayscale | |
18 | 7/5 23:49:51 <Addi:#Imager> $img -> convert( [ 0.5 0.5 ] ) | |
19 | 7/5 23:50:21 <Addi:#Imager> oops | |
20 | 7/5 23:50:28 <Addi:#Imager> $img -> convert( [ 1 -1 ] ) | |
21 | 7/5 23:50:32 <Addi:#Imager> That would invert. | |
22 | 7/5 23:50:43 (irc.infobot.org) <^_TonyC^_:#Imager> -1, 1 ? | |
23 | 7/5 23:50:56 <Addi:#Imager> erm - yes. | |
24 | ||
25 | TC: my original idea of using simple proportional values doesn't work | |
26 | as well as Addi's absolute multipliers. | |
27 |