GraphicsMagick MSL scripts

The idea is:

The Edit Image node seems to leverage GraphicsMagick, but only for a few limited commands and options. Please unlock more of the power of gm for developers!

The simplest way to do this would be to add an option to the Edit Image node that allows developers to execute an MSL script by calling the gm “conjure” command. The only modification needed would be some kind of overrride to the <read> and <write> tags which provide connectivity to the binary streams instead of the filesystem.

An alternative implementation would allow devs to specify the gm command line options as an arbitrary string. Commands that would need to be supported include animate, compare, composite, convert, mogrify, and montage. Many of these options are already referenced by the module, so “all” that would need to change is to add a module option that provides a string field where the options can be specified “by hand”.

My use case:

There are SO many applications for image transformation that the n8n team can’t anticipate all of the ways devs might want to process images. Instead of trying to anticipate all use cases, just give us free rein to execute an image processing script.

I think it would be beneficial to add this because:

It’s impossible for n8n to anticipate all of the image processing needs devs might have. For example, I’m trying to create a “polaroid” by adding a white border that’s 20px on top, left, and right, but 100px on the bottom. That’d be easy with MSL. Without it, I’m limited to the square border option.

Any resources to support this?

http://www.graphicsmagick.org/conjure.html#conj-msl

Are you willing to work on this?

Nobody wants me to work on code that others will use in production. :slight_smile:

Oh, that’s a cool suggestion! +1 from me.

When I was using gm last time, I had to call the command line via Execute Command node and the syntax wasn’t so well structured.

I also see a huge potential of using MSL scripts together with the XML node, as the syntax is basically the same.

So you can prepare a JSON object based on some logic (including if-else-swtich nodes), then convert into MSL script via XML node and finally pass it to the Edit Image node. Really excited to see if this is made possible!