GDL
About building parametric objects with GDL.

Transparent Images for GDL UI's exported from Archicad

GDL Enthusiast
Enthusiast

Hi GDL Experts,

 

I am wondering what the work flow is for exporting an image from Archicad that has a transparent background that can be imported into the user interface.

 

I can export an images from AC with Alpha Channel, however all four standard AC export image types come through with a white background e.g. *png, *jpg, *gif & *tiff (samples attached).

 

Using the following code

ui_pict "Test_Image", 15, 15, 140, 140, 1

The images come through looking like this:

image.png

Also is there a way to set the size of the image on export - the UI_PICT function calls for a specific size. When AC exports it seems to export the extents. I thought adding the red boundary would be a way to control the size but there seems to be a white border beyond this.

 

Is this what other people do or is there a better workflow for this?

 

Thank you so much in advance!

12 REPLIES 12
Barry Kelly
Moderator

Your UI_PICT command is correct.

The 140,140 is the size of the image in the UI.

It will not crop the image, just resize it.

 

I have used .TIF with an alpha channel for my images.

I can't remember why I settled on that format, but it is what I use.

 

The alpha channel mask has to mask around the objects you want to show.

i.e. around the outside and inside of the red line in your image if you want to mask the rest of it.

 

I don't have my regular PC with me with my image software (just an old version of Paint Shop), so I can't really look at your images.

But any image editor should do.

 

I will attach one of my .TIF files so you can have a look at it (I have had to ZIP it as TIF is not allowed as an attachment).

 

Barry.

 

 

 

 

One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
GDL Enthusiast
Enthusiast

Hi Barry, thank you, that is so helpful offering a sample TIF file. I will have a look. I was wondering how one goes about exporting the image from AC that might be different from what I am doing. When I export a TIF with alpha channel, I can't seem to find anything different in the image that shows it has an alpha channel. If it is not to much trouble, could you describe your workflow method of exporting the image in AC? 

A hint: make a vector image with proper dimensions and then save to SVG and use the library tool to convert them to multipage TIFFs: You will get 4 sizes of the image organized in pages for 100%, 125%, 200% nad 250% scalings of the OS UI - works both on MAC and WIN when You scale UI on WIN o change rosolution on MAC.

Hi Piotr, thank you for the guidance. I will give that a try. I had played with the Library tool to convert them to multipage TIFF's without success (the library tool just blinked up on the screen and disappeared without changing anything and I was left none the wiser hehe). I will give it another go and see how it works. Thank you for responding and all the best to you!

I use an old version of Paint Shop Pro I found lying around.

I assume other image editors work much the same.

 

What I do is create the image I want.

I use a different colour for the area I want to mask, just to make it easier to select.

Then I make a selection of the area I want to mask (the green bits) and then invert that selection, so I actually have selected what I want to end up seeing.

You might be able to see the dashed selection in the image below - everything except the green bits.

 

 

BarryKelly_5-1639448437592.png

 

Now I save that selection as an alpha channel.

Then save the image as a TIF and use it in my GDL.

 

When you open the image in an editor, you won't see anything masked, it will just show as the image above.

But it has this hidden alpha channel that will now mask the background when you use this image.

 

Barry.

 

 

One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

I am on windows...and I did a right click entry for a folder containing svg's and making another forlder with "_tiff" added to its name:

 

"C:\Program Files\GRAPHISOFT\LibDev Toolkit 22 (3013)\Tool\WIN\LP_XMLConverter" convertlibrary -excludesvg %1 %1_tif

 

I use here 22s tool, but You can use newer, not sure with older ones, but most probably it works since 20 or 21.

 

Piotr

Hi Barry, the image you sent as a trial works perfectly. Okay so that is the process, add a solid background colour, export to photoshop, add transparency based on colour and then back to the Library for calling. Super great. 

 

Just as a quick question, do you know if AC can export a TIF image file with transparency ready to go to save the intermediate steps? I don't know much about images but wondered with the export with Alpha channel option. It didn't seem to work for me but I wondered if I was doing something wrong. It would be awesome if one could directly save from AC. Thank you for your help, much appreciated!

Hi Piotr, thank you for the handy link. I had a search with the based on your handy link for *LP_XMLConverter* tag and found the LP_XMLConverter oddly in the primary directory of AC22, I would have never have found it otherwise! Thank you. I will have a go with that tool and discover hopefully a new world of fun 🙂


@GDL Enthusiast wrote:

Just as a quick question, do you know if AC can export a TIF image file with transparency ready to go to save the intermediate steps? I don't know much about images but wondered with the export with Alpha channel option. It didn't seem to work for me but I wondered if I was doing something wrong. It would be awesome if one could directly save from AC. Thank you for your help, much appreciated!


 

I have never tried, but I just did, and although it says you can save a .TIFF file with an alpha channel, it didn't work for me either.

 

Barry.

 

One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11