cm/core/graph/gAdvImage.cm can now support grayscaled images using the XClipBlackAndWhiteCompanion.
Old: public void imageToRed(Image image, byte[] cachedPixelData, REDEnv2D env, Transform t, double w, double h) New: public void imageToRed(Image image, byte[] cachedPixelData, REDEnv2D env, Transform t, double w, double h, bool grayScale=false)
Same goes for gImage.
Old: public constructor(Image image, point2D pos=(0, 0), alignment align=upLeft, double h=-1, double w=-1, LayerExpr layer=null) New: public constructor(Image image, Image grayImage=null, point2D pos=(0, 0), alignment align=upLeft, double h=-1, double w=-1, LayerExpr layer=null)
gImageHnd.cm:
Old: final public MagickWand getWand(str key, orientation rot=0 deg, double aspect=1, int maxSize=1024) New: final public MagickWand getWand(str key, orientation rot=0 deg, double aspect=1, int maxSize=1024, bool grayScale=false) Old: final private MagickWand newWand(ImageCache cache, str cacheItemKey, Url url, orientation rot, double aspect, int maxSize, bool resizeMe) New: final private MagickWand newWand(ImageCache cache, str cacheItemKey, Url url, orientation rot, double aspect, int maxSize, bool resizeMe, bool grayScale=false) Old: final private str getCacheItemKey(orientation rot, double aspect, int maxSize, bool needResize) New: final private str getCacheItemKey(orientation rot, double aspect, int maxSize, bool needResize, bool grayScale)
cm/import/imagemagick/readImageProps.cm:
Old: public constructor(sizeI size=(-1, -1), sizeI maxSize=(-1, -1), bool invertRows=false, bool flipRedAndBlue=false, bool invertRGB=false, bool dibPadding=false, float opacity=1f, bool alpha=false, bool invertAlpha=false, bool premultiplyAlpha=false, str filter="Lanczos") { New: public constructor(sizeI size=(-1, -1), sizeI maxSize=(-1, -1), bool invertRows=false, bool flipRedAndBlue=false, bool invertRGB=false, bool dibPadding=false, float opacity=1f, bool alpha=false, bool invertAlpha=false, bool premultiplyAlpha=false, bool grayScale=false, str filter="Lanczos")
cm/import/imagemagick/wand.cm:
Old: private bool getWandPixels(_MagickWand wand, byte[] pixels, byte[] blob, int& channels, int& width, int& height, int maxWidth, int maxHeight, cstr resizeFilter, bool invertRGB, bool invertRows, bool flipRedAndBlue, bool dibPadding, float opacity, bool alpha, bool invertAlpha, bool premultiplyAlpha); New: private bool getWandPixels(_MagickWand wand, byte[] pixels, byte[] blob, int& channels, int& width, int& height, int maxWidth, int maxHeight, cstr resizeFilter, bool invertRGB, bool invertRows, bool flipRedAndBlue, bool dibPadding, float opacity, bool alpha, bool invertAlpha, bool premultiplyAlpha, bool grayScale);