Picture methods

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

Back to Picture class.

Picture.GrayScaleMBS(mode as Integer) as picture

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Graphics & Pictures MBS Picture Plugin 10.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a grayscale copy of the picture.
Example
dim l as Picture = LogoMBS(500)
Backdrop = l.GrayScaleMBS(0)

If you have a mask on the picture, you need to draw that mask in the new picture's mask if you want to keep it.

Modes:

0y = 0.33 * R + 0.5 * G + 0.16 * BFaster version of 3
1y = 0.375 * R + 0.5 * G + 0.125 * BFaster version of 3
2y = 0.2126 * R + 0.7152 * G + 0.0722 * BPhotometric/digital ITU-R
3y = 0.299 * R + 0.587 * G + 0.114 * BDigital CCIR601

Mode 2 and 3 uses doubles and mode 0 and 1 use integers so they should be faster.
Still Mode 0 and 1 are just approximation formulas which trade accuracy for perfomance.

GrayScaleMBS makes a copy of the picture while GrayScale2MBS edits in-place.

Some examples using this method:

The items on this page are in the following plugins: MBS Picture Plugin.


💬 Ask a question or report a problem