Jan
27
2017

Using ImageMagick with Unity

(result image: add watermark/logo stamp to image)

Using ImageMagick with Unity is now possible with the .NET wrapper (github)

Tutorial: Add watermark to image

– Download required DLL files from https://magick.codeplex.com/releases/view/630360 (I used Magick.NET-7.0.4.400-Q8-x64.zip)
– From the zip file, copy “net20\Magick.NET\Magick.NET-Q8-x64.dll” into your Unity project Assets/Plugins/-folder
– From the zip file, copy “net20\Magick.NET\Magick.NET-Q8-x64.Native.dll” into your Unity project root folder (where the project .sln file is also)
– Copy “System.Drawing.dll” (v2.0) from your c: drive into your Unity project Assets/Plugins/-folder (I founded mine from C:\Windows\Microsoft.NET\Framework\v2.0.50727\)
– Download few sample images from Magick.NET examples here and copy those image files into your ‘Assets/Images/’ folder (or adjust the script below to point into correct image path)
– Add the c# script below to your scene and test it!
– See more tutorial sources at Magick github samples directory

example script (c#)


4 Comments + Add Comment

  • Hi, just wondering if I will be able to make an app to publish for Android using this library on Unity?

    • havent tested, but i’m thinking the native library might not work.. going to try later.

  • That sounds really fantastic!
    But ImageMagick as a common graphic php library is capable of interpretation of most of graphic file formats, in the contrary to php GD library.
    Means it should enable to drag the svg, pdf, ai .tif files into Unity and display them as textures. Am I right?

    • that would be amazing! gotta test that soon..

Leave a comment

@unitycoder_com

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.