Skip to content

PixImage usage

aszabo314 edited this page Feb 14, 2018 · 4 revisions
  • Take one channel of a PixImage and use it as new greyscale PixImage:
//take color channel 1, create a new  greyscale image as pixel-by-pixel copy
let pix = PixImage<byte>()
let res = PixImage<byte>(Col.Format.Gray, a.Size)
res.GetChannel(0L).Set(pix.GetChannel(1L))

//view color channel 1 as greyscale PixImage without copying anything
//WARNING: both PixImages view the same data. mutation will destroy everything
let pix = PixImage<byte>()
let res = PixImage<byte>(pix.GetChannel(1L))
Clone this wiki locally
You can’t perform that action at this time.