Re: [go-nuts] Matrix Library && colour uint32's vs uint8's

2016-07-06 Thread Nigel Tao
On Mon, Jul 4, 2016 at 2:50 PM, simran wrote: > Interestingly though, when i do a colour swap (without any type casting > happening now) - the colour problem is still there. https://github.com/simran91/monkeysee/blob/master/mimage/mimage.go says: r, g, b, a :=

Re: [go-nuts] Matrix Library && colour uint32's vs uint8's

2016-07-03 Thread simran
Thanks Matt. After your advice (and some reflection) - i decided to refactor all my code and keep the matrix in colour.Colour values rather than uint32's. Am actually happier i did it, as it provides for more neater / more concise code with better readability. Interestingly though, when i do a

Re: [go-nuts] Matrix Library && colour uint32's vs uint8's

2016-07-03 Thread simran
:) Thanks Dan... my mental blank moment (which lasted an hour!) got me! :) i definitely look a giraffe staring at the headlights now! :) On Mon, Jul 4, 2016 at 12:27 PM, Dan Kortschak < dan.kortsc...@adelaide.edu.au> wrote: > They're packages, not links. > > https://github.com/gonum/matrix > -

Re: [go-nuts] Matrix Library && colour uint32's vs uint8's

2016-07-03 Thread Matt Harden
My previous example didn't compile because I made a change right before hitting share. Here's a working version. https://play.golang.org/p/E3dPLRjFvW On Sun, Jul 3, 2016 at 7:27 PM Dan Kortschak wrote: > They're packages, not links. > >

Re: [go-nuts] Matrix Library && colour uint32's vs uint8's

2016-07-03 Thread Dan Kortschak
They're packages, not links. https://github.com/gonum/matrix - docs: https://godoc.org/github.com/gonum/matrix/mat64 https://github.com/go-gl/mathgl - docs: https://godoc.org/github.com/go-gl/mathgl/mgl64 On Mon, 2016-07-04 at 12:08 +1000, simran wrote: > Hi Dan, > > I get a "page not found"

Re: [go-nuts] Matrix Library && colour uint32's vs uint8's

2016-07-03 Thread Matt Harden
I think you're best off not taking the RGBA values and then building a color from them. Just take the color you're given and use m.Set(x, y, c) on the target image. If you need to modify the color, one way to do that would be to create your own object that implements the color.Color interface (the

Re: [go-nuts] Matrix Library && colour uint32's vs uint8's

2016-07-03 Thread simran
Hi Dan, I get a "page not found" on all those four links... cheers, simran. On Mon, Jul 4, 2016 at 10:22 AM, Dan Kortschak < dan.kortsc...@adelaide.edu.au> wrote: > github.com/gonum/matrix/mat64 (soonish to be gonum.org/pkg/matrix/mat64) > is a general purpose matrix library. > > A more

Re: [go-nuts] Matrix Library && colour uint32's vs uint8's

2016-07-03 Thread simran
I'm still getting the red's turning to pinks... You make an interesting point about the format of the source image... i was assuming that the image/{png,jpeg,gif} packages can read in a file and whatever the colour profiles were, i could get the equivalent RGBA values for them (this does appear

Re: [go-nuts] Matrix Library && colour uint32's vs uint8's

2016-07-03 Thread Dan Kortschak
github.com/gonum/matrix/mat64 (soonish to be gonum.org/pkg/matrix/mat64) is a general purpose matrix library. A more specific image maths package is available at github.com/go-gl/mathgl/mgl{32,64}. On Mon, 2016-07-04 at 10:07 +1000, simran wrote: > Hi Dan, > > I am hoping to find a general

Re: [go-nuts] Matrix Library && colour uint32's vs uint8's

2016-07-03 Thread Matt Harden
This one avoids the type assertion: https://play.golang.org/p/vDB9RboNZj On Sun, Jul 3, 2016 at 5:11 PM Matt Harden wrote: > If the source image is an image.RGBA, then the colors are already int8s; > there's no additional information to lose. Here's an example that swaps

Re: [go-nuts] Matrix Library && colour uint32's vs uint8's

2016-07-03 Thread Matt Harden
If the source image is an image.RGBA, then the colors are already int8s; there's no additional information to lose. Here's an example that swaps the green and red channels of the pixel at (0,0): https://play.golang.org/p/i6F29OsdgD On Sun, Jul 3, 2016 at 5:08 PM simran

Re: [go-nuts] Matrix Library && colour uint32's vs uint8's

2016-07-03 Thread simran
Hi Dan, I am hoping to find a general matrix library as i want to write my own rotation, translation, reflection methods; however, if you do know a good image library doing these, i'd appreciate it as a reference anyway. cheers, simran. On Mon, Jul 4, 2016 at 10:00 AM, Dan Kortschak <

Re: [go-nuts] Matrix Library && colour uint32's vs uint8's

2016-07-03 Thread Dan Kortschak
Are you looking for generalised matrices or simply image rotation/translation/transformation? On Mon, 2016-07-04 at 02:06 +1000, simran wrote: > > Could someone please point me to a good matrix library for Go (i'm > sure > something exists, although i can't seem to find it!). > > Am hoping to

Re: [go-nuts] Matrix Library && colour uint32's vs uint8's

2016-07-03 Thread Dan Kortschak
Are you looking for generalised matrices or simply image rotation/translation? On Mon, 2016-07-04 at 02:06 +1000, simran wrote: > > Could someone please point me to a good matrix library for Go (i'm > sure > something exists, although i can't seem to find it!). > > Am hoping to do some image

[go-nuts] Matrix Library && colour uint32's vs uint8's

2016-07-03 Thread simran
Hi All, Could someone please point me to a good matrix library for Go (i'm sure something exists, although i can't seem to find it!). Am hoping to do some image manipulation for which being able to work with matrices would be great. Have written simple helper stuff for images (i used to find