// Colorspace() allows to set colorspace to image func (im *MagickImage) Colorspace(cs Colorspace) (err error) { c_colorspace := C.ColorspaceType(cs) ok := C.SetImageColorspace(im.Image, c_colorspace) if ok == C.MagickFalse { return &MagickError{"error", "", "could not set colorspace"} } return }
// Sets the wand colorspace type. func (mw *MagickWand) SetColorspace(colorspace ColorspaceType) error { C.MagickSetColorspace(mw.mw, C.ColorspaceType(colorspace)) return mw.GetLastError() }
// SetColorspace set the colorspace used when encoding the image. // Note that not all colorspaces are supported for encoding. See // the documentation on Colorspace. func (in *Info) SetColorspace(cs Colorspace) { in.info.colorspace = C.ColorspaceType(cs) }
// SetColorspace changes the image colorspace. Note // that this only changes how the pixels are interpreted. // If you want to transform the image to another colorspace // use TransformColorspace(). func (im *Image) SetColorspace(cs Colorspace) { im.image.colorspace = C.ColorspaceType(cs) }
// Sets the wand colorspace type. func (mw *MagickWand) SetColorspace(colorspace ColorspaceType) error { ok := C.MagickSetColorspace(mw.mw, C.ColorspaceType(colorspace)) return mw.getLastErrorIfFailed(ok) }