« MBS @ FMTraining.TV -… | Home | MBS Plugin Advent cal… »

MBS Plugin Advent calendar: 16 - GraphicsMagick

Door 16 - GraphicsMagick

Fact of the day
MBS already had an advent calendar for last year. So take a trip back in time to last year and enjoy the articles

Did you know that with FileMaker and the component GraphicsMagick you can change a lot in your images?

Last year we had an advent calendar that only dealt with GraphicsMagick. You are welcome to have a look here as well. To be able to work with an image, the image must be loaded from a file or a container. The appropriate function then gives us a reference number with which we can continue working.

Set Variable [ $Image ; Value: 
	MBS("GMImage.NewFromContainer"; DoorSixTeen::Container) ]

First of all, you can easily query the height and width of an image in a container using the functions GMImage.GetWidth and GMImage.GetHeight.

If we want, we can rotate the image. To do this, we use the GMImage.Rotate function. If we enter a positive angle in the parameters, we rotate to the right. If we enter a negative angle, we rotate to the left.


We can also mirror such an image vertically or horizontally. To do this, we use the functions GMImage.Flip for vertical flipping and GMImage.Flop for horizontal mirroring.


There are also several effects available for editing the image. Let's start with the blur effect. We can create this with GMImage.Blur. We can then set the intensity in the parameters.


We can also use the Sharpen effect with the GMImage.Sharpen function when editing images. However, this effect is not the opposite function to Blur!


If we want to use the effect of a charcoal drawing, GMImage.Charcoal is there to help us.


If you want to try your hand at being a real Leonardo da Vinci, you can use the GMImage.OilPaint function to apply an oil painting effect to your photos.


If you want everything to be really swirly on your images, use the GMImage.Swirl function. This creates a swirl in your image.


A little depth in the images can often do no harm either. You can add an embossing effect with the GMImage.Emboss function.


Grayscale images in photography can be very aesthetic and give the image a completely different mood. Use the GMImage.SetType function and enter a 2 in the parameters to obtain a grayscale image.

# Load from container 
Set Variable [ $Image ; Value: MBS("GMImage.NewFromContainer"; DoorSixTeen::Original) ] 
# Grayscale
Set Variable [ $result ; Value: MBS("GMImage.SetType";$Image; 2) ] 
If [ MBS("IsError") = 0 ] 
	# Write to container
	Set Variable [ $result ; Value: MBS("GMImage.WriteToPNGContainer";$Image) ] 
	Set Field [ DoorSixTeen::Output ; $result ] 
End If
# Release image
Set Variable [ $r ; Value: MBS("GMImage.Free"; $Image) ] 

Many people only see the negative in everyday life. For you, this should only be the case with images. You can use the GMImage.Negate function to view the negative of an image. If you use the function twice in a row, you will get back the original image.


The GMImage.Solarize function offers us a similar effect. However, if we use the function twice in a row, the pure white areas remain black. If we combine the function with GMImage.Negate, our monkey gets a pink cap. The functions are therefore similar but not identical.

This and much more awaits you in the GraphicsMagick component. I hope you enjoy using it!


Monkeybread Software Logo with Monkey with Santa hat
15 👈 16 of 24 👉 17
Claris FileMaker Plugin
16 12 23 - 14:51