Jump to content

Recommended Posts

Posted (edited)

Hello everyone! I'm new here and I come with an important question.

I have a problem with automating the process of pasting images into a place on a prepared mockup.

I would like to streamline this process because manually entering hundreds of images and saving them later is time-consuming.

I have a mockup (several versions) for selling posters/photos and I set the layers in Affinity so that after loading the image using the Apply Image function, it automatically sets the appropriate proportions and adjusts the loaded image to the mockup (perspective correction, mask, etc.):

image.thumb.png.0082c39786275eba07cd9c532ab27c90.png

It works the way I want, but when I have to upload several hundred images in this way, it becomes a problem. I wanted to speed it up and tried to record a Macro with image replacement + automate the process via Batch Job, but unfortunately it doesn't work, i.e. it only creates a copy of the input data.

Do you know any way to streamline this? Some plugin? I tried to make a Python script that clicks the appropriate functions one by one, but so far I don't have satisfactory results.

Edited by btymosiak
Posted

Can you upload the Affinity document (shown above), the macro and the base image to the forum?

To save time I am currently using an automated AI to reply to some posts on this forum. If any of "my" posts are wrong or appear to be total b*ll*cks they are the ones generated by the AI. If correct they were probably mine. I apologise for any mistakes made by my AI - I'm sure it will improve with time.

Posted

Sorry I have no solution, just having a similar setup but no automation. I do have a problem with blurry images. Did you ever come across blurry images in your mockups? Do you link or embed your files?

Posted

No, I don't have a problem with that. Do you have blurry images in the viewport or after export too?

In this case, when using the Apply Image filter, the images are embedded, when I upload images using the Place function, I try to link them.

Posted

I can't read your files as I use V1 but I would take a different approach as the macro copy/paste is not going to substitute images as you need

Use Photo batch to produce picture files of the correct size with the perspective applied
Produce seperate files for the background and foreground. I've used a frame in front of the picture, you may prefer to have the frame as part of the background with the picture on top but that will need more accurate positioning
Use imagemagick to stitch them together, the example was made from 4 files

This command should be a good starting point
magick background.png -draw "image over 386,126 0,0 picture.png" frame.png foreground.png -background none -alpha set -flatten result.png

The 386,12 represents the x,y dimensions from the top left, adjust as necessary as I used an image 800x600px

Then you'll need to use a shell script appropriate for your OS, using windows it'd be a simple bat file with a loop
Good luck

result.png

Microsoft Windows 11 Home, Intel i7-1360P 2.20 GHz, 32 GB RAM, 1TB SSD, Intel Iris Xe
Affinity Photo - 24/05/20, Affinity Publisher - 06/12/20, KTM Superduke - 27/09/10

Posted

@drpixels I hadn't thought of that. Now it seems obvious - I'll see how it works. Thanks!

@David in Яuislip Your proposal is extensive, but I'll check how it works. Maybe I'll learn something new. Thanks!

I'm going to keep trying, if I have any new questions or problems I'll ask 🙂

  • 2 weeks later...
Posted
On 5/5/2025 at 11:27 PM, drpixels said:

i know your post is about doing this in photo but with data merge in publisher it can be done very easily, with a csv file.

 

After few days I tried your solution and it works perfectly! It's that simple now! Thank you! 

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.