Importing PIL library python

Hello there!

My final aim is to overlay two pictures of the same size (stored in the same PC Ignition is running): one picture will act as a "square" frame, and the other as the main content.

I have searched on the Internet and found this (Overlay two same sized images in Python - Stack Overflow) using a python library.

I was wondering the following:

  1. Is there an easy way to do the overlay with an embedded Ignition/Perspective tool/functionality?

  2. I am not sure about how to import the PIL library (3rd party). I am aware that I have to copy some files into " C:\Program Files\Inductive Automation\Ignition\user-lib\pylib", but no idea about what files or folder to copy. In the Internet I can find the source in .tar.gz format, but not in a .py or .zip. Could anyone clarify or help me here?

Another aspect is that I think this library has some C instances, which can cause the library to not work in Ignition. Could this be confirmed?

Thanks in advance!

If the lib uses C, it won't work. Ignition uses Jython, which runs on a JVM. So you can use Java, but not C.

Can you show an example of these 2 images ?

Hi @pascal.fragnoud ,

thanks for your reply.

The final picture would be something like:

image

Where one picture/layer will be the base image (bolts and plastic bags), and the other one will be a no-background image with the coloured squares in defined positions.

Just put the image in a coordinate container and use labels to make the rectangles:

image

I added the purple one, it's a simple label with no text and this style: border: solid 6px purple

It makes it super easy to change things.
ie, with border: dotted 6px purple
image

with border: dashed 10px red and border-radius: 50
image

3 Likes

Hi @pascal.fragnoud ,

yes, that would work for my case now!

Thanks!!

Looks a bit like this one, maybe it gives inpiration

1 Like