Dave Posted May 29 Report Share Posted May 29 Does anyone know of a way to make the background of UniPic images invisible? For example, I have used the "UniPics-Lights & Lamps-074.png" image. It is a green circle but has a white square background. If I use it on a screen with a white background, the square is not visible, but if I use it on any other colour background, the white square is visible. I could save them as a bitmap and edit the background out, but that is a lot of work to do for every image. I saw another image, almost identical, in a sample PID program, "UniPics-Leds-Green-04-On.Png" . This image has a transparent square background, but I can't find the source for this image, and I don't see any property that I can set the background to transparent. Quote Link to comment Share on other sites More sharing options...
Saragani Posted May 30 Report Share Posted May 30 The image is a png with a transparent background. It should have been drawn transparent. If you use other UniPics with transparent backgrounds, do you see them with white/black background, or with a transparent one? What about other transparent images you download from the web? Quote Link to comment Share on other sites More sharing options...
pascal Posted May 31 Report Share Posted May 31 Dave, https://onlinepngtools.com/create-transparent-png I often use this for modification of self designed png files Quote Link to comment Share on other sites More sharing options...
Dave Posted May 31 Author Report Share Posted May 31 Hi Saragani. So far, all of the unipics that I have used display the white background...but I have mostly only used the lamps. I will check some others though, just to see. The few .png images that I have downloaded from the web are the same, but usually darker background. Pascal, thanks for the link. That looks like a very useful tool. I will try it out Quote Link to comment Share on other sites More sharing options...
Saragani Posted June 6 Report Share Posted June 6 @Dave Then it might be something with your computer. Currently I don't know what can cause this issue. Do other elements (like circular gauge, Button, linear gauge, etc.) have a transparent background? Btw, can you download the following image? https://www.transparentpng.com/thumb/google-logo/google-logo-png-icon-free-download-SUF63j.png Then put it in a screen and tell me if you see it transparent. Quote Link to comment Share on other sites More sharing options...
Dave Posted June 8 Author Report Share Posted June 8 "Btw, can you download the following image?" I downloaded the image and it did indeed have a transparent background. Unipics from the folder, "Unitronics \ Unitronics Visilogic_C\ Data \ ImagesC \ UniPics \ Large \ Switches \ Indexed Large" all still display a white background. I tried the "onlinepngtools" app, and it worked to make the background transparent, but now I have the diagonal lines across the image. Also, I had to save it to a word doc first, then "save as picture" in order to be able to use it with UniLogic. Quote Link to comment Share on other sites More sharing options...
Saragani Posted June 8 Report Share Posted June 8 @Dave Thanks for the update. It might be something with the watermark removal code that somehow fails on your computer, and somehow creates a white background, or something with the image itself (and not the watermarked image). I have not encountered this issue before, so I will have to investigate and dig in the code. I might give you a small tool in order to debug the issue. I hope to work on it next week as soon as possible. Quote Link to comment Share on other sites More sharing options...
MVP 2022 Ausman Posted June 9 MVP 2022 Report Share Posted June 9 Dave, a question that might be relevant here is what image programs do you have on your computer? Perhaps they are basically changing the way the PC handles any .png file....changing the bit format etc. which is then flowing on into your usage issues. cheers, Aus Quote Link to comment Share on other sites More sharing options...
Dave Posted June 9 Author Report Share Posted June 9 I have had this issue right from the start with UniLogic...on multiple PC's and laptops. Even with VisiLogic, but there I can check the "transparent background" check box to easily eliminate it. In UniLogic, I set the background fill to transparent and it does nothing. I was just putting up with it up until now, but it would be nice to get to the bottom of it. As for image programs, I think all I have is what ever comes standard with Windows, but I'll double check that this weekend. Currently, I am running Windows 10 Quote Link to comment Share on other sites More sharing options...
Saragani Posted June 11 Report Share Posted June 11 @Dave Please download the following images and tell me if it has a transparent background when you add it in UniLogic. These are the images from UniPics after I have removed the watermark from them Quote Link to comment Share on other sites More sharing options...
Saragani Posted June 12 Report Share Posted June 12 @Dave After you check those images, then please check the following image, and tell me if it makes a difference. Thanks Quote Link to comment Share on other sites More sharing options...
Dave Posted June 12 Author Report Share Posted June 12 Hi Saragani. All 3 images worked fine...transparent background and no watermarks. Quote Link to comment Share on other sites More sharing options...
Saragani Posted June 13 Report Share Posted June 13 @Dave This is weird. The first 2 images are the same images that are created when UniLogic removes the watermark from the image. I just ran the code, but instead of using it inside the project, I saved it to disk. I will have to further investigate it. Quote Link to comment Share on other sites More sharing options...
Saragani Posted June 14 Report Share Posted June 14 @Dave I have sent you a private message with a tool that may help me understand what's wrong. My current guess is that it's something with the png encoder which removes the opacity on save. Quote Link to comment Share on other sites More sharing options...
Saragani Posted June 14 Report Share Posted June 14 Issue sorted. Dave was taking the images from VisiLogic folder (which doesn't have the transparency), rather than from UniLogic UniPics folder. The folder appears in the "Custom Places" shortcut while browsing an image in UniLogic: Quote Link to comment Share on other sites More sharing options...
MVP 2022 Ausman Posted June 14 MVP 2022 Report Share Posted June 14 I've been intrigued by this issue, and glad it's resolved. But as someone who never uses colour images, I need to ask the question.... In Vision, the single pixel method for defining transparency is used. For simplicity of using and applying on every image a user might use, can this be done in Unilogic? Or does the method already exist and has been forgotten in this case? cheers, Aus Quote Link to comment Share on other sites More sharing options...
Saragani Posted June 15 Report Share Posted June 15 In UniLogic we use the transparency of the image itself. Png images support alpha channel. It is not just a pixel is transparent or not, it can be half transparent, and there are 256 levels of transparency. In VisiLogic it was done in the single pixel method, since there was no other way (Visual Basic 6 does not support alpha channel, anti-aliasing etc.) Quote Link to comment Share on other sites More sharing options...
MVP 2022 Ausman Posted June 15 MVP 2022 Report Share Posted June 15 Thanks Saragani, I suspected as much but thought it worth an ask. 🙂 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.