Platforms to show: All Mac Windows Linux Cross-Platform

Back to PictureMBS class.

Next items

PictureMBS.AlphaChannel as PictureMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 8.7 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The alpha channel as a new PictureMBS object.
Example
Var p as new PictureMBS(100,100,PictureMBS.ImageFormatRGB)
Var r as PictureMBS = p.AlphaChannel
r.fillrect(100) // fill only alpha channel

Returns nil if this channel does not exist.
No copy is made of the actual pixel data. Modifying the channel picture will modify the original picture.
Use this function to access the pixels of the channel directly.
The resulting PictureMBS object is a grayscale picture.

Some examples using this method:

PictureMBS.ApplyMatrix(dest as PictureMBS, MatrixDimension as Integer, matrix() as Integer) as PictureMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 9.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Applies a 5x5 matrix to the picture.
Example
Var matrix(24) as Integer
Var x,y as Integer
Var value as Integer

for y=0 to 4
for x=0 to 4
matrix(x+y*5)=value // fill matrix
next
next

Var s,d as PictureMBS // make source and dest somewhere

d=s.ApplyMatrix(d, 5, matrix)

MatrixDimension: Size of the matrix: 1 to 50. This is the width and height of the matrix.
matrix: The matrix array must contain exactly MatrixDimension*MatrixDimension values. (ubound(matrix)=MatrixDimension*MatrixDimension-1)
delta: Optional value. Default is 0.
ScaleFactor: Optional value. Default is 1.0.

if dest is nil, the picture factory is used to create a new picture.
On success dest or the new picture is returned.
If dest is not nil, it must match the size of the original picture.

For each pixel in the dest image the following operation is done

  • Make sum of all source pixels multiplied with their matrix entry.
  • add to the sum the delta value
  • multiply the sum by ScaleFactor
See the example project for several example matrices.

A matrix value of 255 or more leaves the dest pixel away from the sum.

Works with Gray, RGB and CMYK pictures and supports alpha channel.

See also:

Some examples using this method:

PictureMBS.ApplyMatrix(dest as PictureMBS, MatrixDimension as Integer, matrix() as Integer, delta as Integer) as PictureMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 9.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Applies a 5x5 matrix to the picture.
Example
Var matrix(24) as Integer
Var x,y as Integer
Var value as Integer

for y=0 to 4
for x=0 to 4
matrix(x+y*5)=value // fill matrix
next
next

Var s,d as PictureMBS // make source and dest somewhere

d=s.ApplyMatrix(d, 5, matrix, 5)

MatrixDimension: Size of the matrix: 1 to 50. This is the width and height of the matrix.
matrix: The matrix array must contain exactly MatrixDimension*MatrixDimension values. (ubound(matrix)=MatrixDimension*MatrixDimension-1)
delta: Optional value. Default is 0.
ScaleFactor: Optional value. Default is 1.0.

if dest is nil, the picture factory is used to create a new picture.
On success dest or the new picture is returned.
If dest is not nil, it must match the size of the original picture.

For each pixel in the dest image the following operation is done

  • Make sum of all source pixels multiplied with their matrix entry.
  • add to the sum the delta value
  • multiply the sum by ScaleFactor
See the example project for several example matrices.

A matrix value of 255 or more leaves the dest pixel away from the sum.

Works with Gray, RGB and CMYK pictures and supports alpha channel.

See also:

PictureMBS.ApplyMatrix(dest as PictureMBS, MatrixDimension as Integer, matrix() as Integer, delta as Integer, ScaleFactor as Double) as PictureMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 9.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Applies a 5x5 matrix to the picture.
Example
Var matrix(24) as Integer
Var x,y as Integer
Var value as Integer

for y=0 to 4
for x=0 to 4
matrix(x+y*5)=1 // fill matrix
next
next

Var s,d as PictureMBS // make source and dest somewhere

s = new PictureMBS(LogoMBS(500))
d = new PictureMBS(500, 500, PictureMBS.ImageFormatRGB)

// Blur with 5x5 Matrix
d=s.ApplyMatrix(d, 5, matrix, 1, 1.0/25.0)

Backdrop = d.CopyPicture

MatrixDimension: Size of the matrix: 1 to 50. This is the width and height of the matrix.
matrix: The matrix array must contain exactly MatrixDimension*MatrixDimension values. (ubound(matrix)=MatrixDimension*MatrixDimension-1)
delta: Optional value. Default is 0.
ScaleFactor: Optional value. Default is 1.0.

if dest is nil, the picture factory is used to create a new picture.
On success dest or the new picture is returned.
If dest is not nil, it must match the size of the original picture.

For each pixel in the dest image the following operation is done

  • Make sum of all source pixels multiplied with their matrix entry.
  • add to the sum the delta value
  • multiply the sum by ScaleFactor
See the example project for several example matrices.

A matrix value of 255 or more leaves the dest pixel away from the sum.

Works with Gray, RGB and CMYK pictures and supports alpha channel.

See also:

PictureMBS.AutoLevel as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 9.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Applies auto levels on the picture.
Example
Var l as Picture = LogoMBS(500)
Var p as new PictureMBS(l)
call p.AutoLevel
window1.Backdrop = p.CopyPicture

The histogram is built, white and back points are searched and all pixels adjusted.
Returns true on success and false on any error.

Works only with RGB pictures.

See also:

PictureMBS.AutoLevel(x as Integer, y as Integer, w as Integer, h as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 9.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Applies auto levels on the picture.
Example
Var l as Picture = LogoMBS(500)
Var p as new PictureMBS(l)
call p.AutoLevel(0,0,50,50)
window1.Backdrop = p.CopyPicture

The histogram is built, white and back points are searched and all pixels adjusted.
Returns true on success and false on any error.

Works only with RGB pictures.

See also:

PictureMBS.BlackChannel as PictureMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 11.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The black channel of a CMYK picture as a new PictureMBS object.

Returns nil if this channel does not exist.
No copy is made of the actual pixel data. Modifying the channel picture will modify the original picture.
Use this function to access the pixels of the channel directly.
The resulting PictureMBS object is a grayscale picture.

PictureMBS.BlueChannel as PictureMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 8.7 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The blue channel as a new PictureMBS object.
Example
Var p as new PictureMBS(100,100,PictureMBS.ImageFormatRGB)
Var r as PictureMBS = p.BlueChannel
r.fillrect(100) // fill only blue channel

Returns nil if this channel does not exist.
No copy is made of the actual pixel data. Modifying the channel picture will modify the original picture.
Use this function to access the pixels of the channel directly.
The resulting PictureMBS object is a grayscale picture.

PictureMBS.BoxBlurFilter(dest as PictureMBS, Radius as Double, Iterations as Integer, Vertical as boolean = true, Horizontal as boolean = true) as PictureMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The box blur filter.
Example
Var boxPic,tempObj As PictureMBS
Var logo as Picture = LogoMBS(500)
Var pictureObj as new PictureMBS(logo)

tempObj = New PictureMBS(pictureObj.Width, pictureObj.Height, pictureObj.ImageFormat)
boxPic = pictureObj.BoxBlurFilter(tempObj, 3.0, 3)

Backdrop=boxpic.CopyPicture

if dest is nil, the picture factory is used to create a new picture.
On success dest or the new picture is returned.
If dest is not nil, it must match the size of the original picture.

Vertical and Horizontal define whether effect is applied horizontal and/or vertical.

Returns nil on any error.
Works with Gray, RGB and CMYK pictures and supports alpha channel.

See also:

Some examples using this method:

PictureMBS.BoxBlurFilter(dest as PictureMBS, Radius as Double, Vertical as boolean = true, Horizontal as boolean = true) as PictureMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The box blur filter.

if dest is nil, the picture factory is used to create a new picture.
On success dest or the new picture is returned.
If dest is not nil, it must match the size of the original picture.

Vertical and Horizontal define whether effect is applied horizontal and/or vertical.

Returns nil on any error.
Works with Gray, RGB and CMYK pictures and supports alpha channel.

See also:

PictureMBS.BoxBlurFractionalFilter(dest as PictureMBS, Radius as Double) as PictureMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The box blur filter for the radius fraction.

If you call BoxBlurFilter and BoxBlurFractionalFilter with a radius of 3.5 the BoxBlurFilter does the 3.0 and BoxBlurFractionalFilter does the 0.5.

if dest is nil, the picture factory is used to create a new picture.
On success dest or the new picture is returned.
If dest is not nil, it must match the size of the original picture.

Returns nil on any error.

Some examples using this method:

PictureMBS.EngraveFilter(dest as PictureMBS, level as Integer) as PictureMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 9.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Applies an engrave filter to the image.

if dest is nil, the picture factory is used to create a new picture.
On success dest or the new picture is returned.
If dest is not nil, it must match the size of the original picture.

Level must be between 0 and min(width,height).

Returns nil on any error.

PictureMBS.GainFilter(dest as PictureMBS, gain as Double, bias as Double) as PictureMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Applies the gain filter to the picture.

if dest is nil, the picture factory is used to create a new picture.
On success dest or the new picture is returned.
If dest is not nil, it must match the size of the original picture.

Returns nil on any error.

Some examples using this method:

PictureMBS.GammaFilter(dest as PictureMBS, gamma as Double) as PictureMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Changes the gamma value of the picture.

If dest is nil, the picture factory is used to create a new picture.
On success dest or the new picture is returned.
If dest is not nil, it must match the size of the original picture.

Returns nil on any error.

See also:

Some examples using this method:

PictureMBS.GammaFilter(dest as PictureMBS, gamma as Double, alphaGamma as Double) as PictureMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Changes the gamma value of the picture.

If dest is nil, the picture factory is used to create a new picture.
On success dest or the new picture is returned.
If dest is not nil, it must match the size of the original picture.

If the picture has no alpha channel, the alpha parameter is ignored.

Returns nil on any error.

See also:

PictureMBS.GammaFilter(dest as PictureMBS, redGamma as Double, greenGamma as Double, blueGamma as Double) as PictureMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Changes the gamma value of the picture.

If dest is nil, the picture factory is used to create a new picture.
On success dest or the new picture is returned.
If dest is not nil, it must match the size of the original picture.

For grayscale pictures the gray color is calculated from red, green and blue value.

Returns nil on any error.

See also:

PictureMBS.GammaFilter(dest as PictureMBS, redGamma as Double, greenGamma as Double, blueGamma as Double, alphaGamma as Double) as PictureMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Changes the gamma value of the picture.

If dest is nil, the picture factory is used to create a new picture.
On success dest or the new picture is returned.
If dest is not nil, it must match the size of the original picture.

For grayscale pictures the gray color is calculated from red, green and blue value.
If the picture has no alpha channel, the alpha parameter is ignored.

Returns nil on any error.

See also:

PictureMBS.GrayChannel as PictureMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 8.7 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The gray channel as a new PictureMBS object.
Example
Var p as new PictureMBS(100,100,PictureMBS.ImageFormatRGB)
Var r as PictureMBS = p.GrayChannel
r.fillrect(100) // fill only gray channel

Returns nil if this channel does not exist.
No copy is made of the actual pixel data. Modifying the channel picture will modify the original picture.
Use this function to access the pixels of the channel directly.
The resulting PictureMBS object is a grayscale picture.

PictureMBS.GreenChannel as PictureMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 8.7 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The green channel as a new PictureMBS object.
Example
Var p as new PictureMBS(100,100,PictureMBS.ImageFormatRGB)
Var r as PictureMBS = p.GreenChannel
r.fillrect(100) // fill only green channel

Returns nil if this channel does not exist.
No copy is made of the actual pixel data. Modifying the channel picture will modify the original picture.
Use this function to access the pixels of the channel directly.
The resulting PictureMBS object is a grayscale picture.

PictureMBS.HMirror

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 8.7 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Mirrors the image content horizontally (flip).
Example
// get some picture
Var l as Picture = LogoMBS(500)
// create new image
Var p as new PictureMBS(l)
// mirror
p.HMirror
// show in window
window1.Backdrop = p.CopyPicture

Works with Gray, RGB and CMYK pictures and supports alpha channel.

Some examples using this method:

PictureMBS.Invert

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 8.7 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Inverts the image data.

Works with Gray, RGB and CMYK pictures and supports alpha channel.

See also:

PictureMBS.Invert(x as Integer, y as Integer, w as Integer, h as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 8.7 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Inverts the image data in the given area.

Works with Gray, RGB and CMYK pictures and supports alpha channel.

See also:

PictureMBS.MagentaChannel as PictureMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 11.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The magenta channel of a CMYK picture as a new PictureMBS object.

Returns nil if this channel does not exist.
No copy is made of the actual pixel data. Modifying the channel picture will modify the original picture.
Use this function to access the pixels of the channel directly.
The resulting PictureMBS object is a grayscale picture.

PictureMBS.MapInRows(FirstRow as Integer, LastRow as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 17.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Maps in given row range.

This function does nothing if given rows are already mapped in.

Fails if range is invalid, image is invalid or mapping is not possible.
Returns true if not a mapped image.

Will resize memory buffer size to be big enough for those rows.

PictureMBS.MirroredView as PictureMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 10.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a new PictureMBS object which draws into the existing on, but has all rows vertically mirrored.

So if the new picture draws into the first row, the change will be in the last row of the original picture.

Some examples using this method:

PictureMBS.Multiply

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 18.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Multiplies alpha channel of whole picture.

Pictures with alpha channel must be multiplied, while pictures with mask have the alpha unmultiplied and inverse in the mask.

See also:

PictureMBS.Multiply(x as integer, y as integer, width as integer, height as integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 18.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Multiplies alpha channel of a rectangle of the picture.

Pictures with alpha channel must be multiplied, while pictures with mask have the alpha unmultiplied and inverse in the mask.

See also:

PictureMBS.NeonFilter(dest as PictureMBS) as PictureMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 9.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Applies a neon filter to the image.
Example
Var l as Picture = LogoMBS(500)
Var p as new PictureMBS(l)
p = p.NeonFilter(nil)
window1.Backdrop = p.CopyPicture

if dest is nil, the picture factory is used to create a new picture.
On success dest or the new picture is returned.
If dest is not nil, it must match the size of the original picture.

Returns nil on any error.
Works with Gray, RGB and CMYK pictures and supports alpha channel.

PictureMBS.OilFilter(dest as PictureMBS, levels as Integer, range as Integer) as PictureMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 9.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Applies a oil filter to the image.
Example
Var l as Picture = LogoMBS(500)
Var p as new PictureMBS(l)
p = p.OilFilter(nil,5,5)
window1.Backdrop = p.CopyPicture

if dest is nil, the picture factory is used to create a new picture.
On success dest or the new picture is returned.
If dest is not nil, it must match the size of the original picture.

Levels must be between 0 and 256.
Range must be between 0 and min(width,height).

Returns nil on any error.
Works with Gray, RGB and CMYK pictures and supports alpha channel.

PictureMBS.Scale(source as PictureMBS, temp as PictureMBS, mode as Integer, width as Integer, height as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Large Picture MBS Images Plugin 8.7 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Scales the picture to the given size.

The final image is stored in the PictureMBS object you call this method on.
On low memory this function can fail or the image may look bad. (e.g. all black)

The size of the temporary picture must have the size of the destination width and the source height. Use ImageFormatScaling when you create the temp image to give it the correct size. Temp picture may not be mapped.

For scaling with the same size as the picture already has, the scaling is still performed.

Returns true on success and false on any error. (e.g. width=0)

Use the constants for the mod:
ScaleTriangletriangle
ScaleBoxbox, nereast neighbor
ScaleLanczos3lanczos 3
ScaleLanczos8lanczos 8
ScaleMitchellmitchell
ScalePoly3poly 3
ScaleCubiccubic

This function is optimized for several image formats:
- Gray to Gray.
- RGB to Gray uses R*0.3+G*0.59+B*0.11.
- RGB to RGB.
- Gray to RGB fill red, green and blue with the same gray value.
If an alpha channel exists in both images, it is copied.

Next items

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


The biggest plugin in space...