Merge Text Data and Images to Create a Collage


#1

Hello,

I think this might be similar to creating a mailing label having an image.

We have about 2000 images we need to create for product labels. We have multiple image components in png format (to preserve image transparency in the backgrounds). We also have all the the text variants in a spreadsheet. I can put the text and images into my brand new Pan X database.

I want to assemble a new image from the text variant and image component data.

If needed, I can make all of the image components have identical dimensions where the positioning of the non-transparent portions of each image is in the correct location. Can Pan X handle the Z-index (in front/in back) for the image staking? If not, I could make component sub-assemblies so that image component stacking is in the image data.

Normally, I would figure this out on my own with the documentation. This time, the project is due Thursday, or the company literally will lose the right to sell in the U.S. market, and I’m sure the government’s servers will be crashing the last few days. I’m a little anxious and wondering if Pan X users can point me to the proper documentation and offer suggestions and advice. I looked over the Image Object docs and a couple of other docs, but I’m not sure they explain this type of merge and how to do it.

Thanks,
Mike


#2

Once an object is selected you can use the bringtofront or sendtoback statements to alter their order on the form.


#3

Hi Gary,

Thanks for the advice on the image stacking. Which documentation explains the assembly of the image best?

Mike


#4

I don’t know that there is much direct documentation on reordering several images other than the rudimentary description of the two statements in the Help file. If you know what order the objects should end up in and their names, you could select each in order and move them one at a time. Say you want the final order from back to front of these example objects to be object3, object2, object1. You could use code like this:

object object1
sendtoback
selectnoobjects
object object2
sendtoback
selectnoobjects
object object3
sendtoback
selectnoobjects

After running object3 will be at the back while object1 will be on top and object2 will be in between. The intermediate selectnoobjects may not be necessary but I always insert them “just in case”. Of course you could run them in reverse order but using bringtofront instead of sendtoback. Also if you have the order listed in a variable you could use a looparray to run the code.

This is how it should work in therory but be warned, I have had some inconsistent behavior in the past with manually reordering objects.


#5

On further thought, if you are only talking about setting the order on the form once and do not need to change it along the way you can do that in graphics mode by selecting an object and using the Objects>Arrange menu items. Here you can Bring to Front, Send to Back, Bring Forward or Send Backward each object in turn as it is manually selected. A note for convenience in selecting objects hidden behind other objects you command-click on the active object and it will then select the next object behind it.


#6

Hi Mike! Welcome to Panorama! (Mike and I chatted by email last night, as he was evaluating Panorama.)

Normally, stacking of objects in Panorama works just like any other graphics layout program, for example Keynote. You can select an object, then use the Object>Arrange>Bring to Front/Send to Back commands to alter the Z-order. This can also be done by right clicking on the object. There isn’t a specific documentation for this, but it is mentioned and demonstrated in the Selecting a Completely Hidden Object section of the Selecting Form Objects page.

You might want to start by creating a few colored rectangles and playing with this if you are not familiar with this from other programs.

However, you want to do this with Image Display objects, not rectangles. And unfortunately, there is a bug there. This has been a very frustrating bug because it involves weird behavior of the Apple API Panorama X uses to draw the images. When images are drawn with this API, the always appear with a Z-order above everything else in the window, no matter what Z-order you specify. So it is possible to stack images, but you can’t stack something else on top of them, like text. It’s probably not much use to you, but here is a link to this bug report in our system:

There is one situation where Panorama X uses a different API to draw the image, and the Z-order stacking does work. I think this might work for your application. If the image alignment is set to Tile, then the Z-order stacking will work correctly (I just double checked to make sure this is true). Of course you don’t want your image to tile, but if the Image Display object is exactly the same size as the image being displayed, then only one “tile” will be displayed, so essentially it will be the same as not using the tile option. To learn more about the Tile option, see the Image Display Object page (the Tile option is near the bottom).

By the way, I did verify that when stacking PNG images the transparency works, even translucency (partial transparencty), and I was able to stack both images and text, as long as I used the Tile option. Since you say that you can make all of the images have identical dimensions, I think this will work for you.

I am assuming that by “assemble a new image” you mean that you want to stack multiple images and text on top of each other so that they look like a single image, and possibly print like a single image. Stacking the images as Gary and I have described won’t actually create a new image, it will just look like one.


#7

Wow! I love this community. Thanks for the advice Gary and Jim.

I am going to try the Tile alignment Jim mentioned because of the API buy. I do need an image file output. I am guessing, but with a Print command, I can probably figure out how to batch create PDF files, or files of another format, using the built in Mac Preview or one or another image program.

By way of background, I have most of the image apps and know how to use many of them). I’m mostly good with image software and scientific stuff, but have a blindspot for relational database architecture (I tried in the past) and coding (I can’t remember the codes).

I’ll let you know how it worked for me or if I need more help, tomorrow.

Mike


#8

If you want to automate creating PDF files, Panorama X has a way to do that. Search for printtopdf in the help, or click on this link:

If you needed to make new PNG files, I think you could use ImageMagick. I am not an expert in that program, but I think it might be able to do what you are asking. It doesn’t really have anything to do with Panorama, but it could, since it is a command line program and Panorama can drive command line programs. I’m pretty sure I know of at least one Panorama user that has created a Panorama application that used ImageMagick. However, anything using ImageMagick is going to take some fairly serious coding.

https://www.imagemagick.org/script/index.php

Here is the primary Panorama help page dealing with running shell scripts from inside Panorama.