]> git.imager.perl.org - imager.git/blame_incremental - design/colmatrix.txt
handle failure to clone the log filehandle when cloning the Imager context
[imager.git] / design / colmatrix.txt
... / ...
CommitLineData
1Times are +1000 2001 (day/month)
27/5 23:45:19 <Addi:#Imager> If people want something smarter they can just convert to gray themselves.
37/5 23:45:39 (irc.infobot.org) * TonyC:#Imager doesn't even know how to convert to greys in Imager
47/5 23:46:01 <Addi:#Imager> That's what I want to add...
57/5 23:46:03 <Addi:#Imager> But like this:
67/5 23:46:56 <Addi:#Imager> $gray = $img->cspace( matrix=> [[ 0.3 0.3 0.4 ]] )
77/5 23:47:09 <Addi:#Imager> Or actually
87/5 23:47:12 (irc.infobot.org) <^_TonyC^_:#Imager> $greyimg = $img->convert([10,20,5]); # one channel output from 3
97/5 23:47:15 <Addi:#Imager> $gray = $img->cspace( matrix=> [[ 0.3 0.3 0.4 0 ]] )
107/5 23:47:56 <Addi:#Imager> If you have an extra parameter then you can do adds too.
117/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
127/5 23:48:54 <Addi:#Imager> Often you have an imaginary color that is fixed to be 1
137/5 23:49:09 (irc.infobot.org) <^_TonyC^_:#Imager> that would simplify it
147/5 23:49:10 <Addi:#Imager> So each pixel has the form [r g b 1]
157/5 23:49:15 <Addi:#Imager> or [r g b a 1]
167/5 23:49:23 <Addi:#Imager> Always one more than the image actually has
177/5 23:49:34 <Addi:#Imager> That way you can do like for grayscale
187/5 23:49:51 <Addi:#Imager> $img -> convert( [ 0.5 0.5 ] )
197/5 23:50:21 <Addi:#Imager> oops
207/5 23:50:28 <Addi:#Imager> $img -> convert( [ 1 -1 ] )
217/5 23:50:32 <Addi:#Imager> That would invert.
227/5 23:50:43 (irc.infobot.org) <^_TonyC^_:#Imager> -1, 1 ?
237/5 23:50:56 <Addi:#Imager> erm - yes.
24
25TC: my original idea of using simple proportional values doesn't work
26as well as Addi's absolute multipliers.
27