Jump to content

Use Macro to add white background to product images of different heights, but the same width


Recommended Posts

Hi Guys, I'm pretty new to Affinity and have used it for all sorts of cool stuff, but I've picked it up recently to do a task I thought it might handle quite easily.

I have product images of different dimensions, all random, and I usually define the longest dimension which is the width down to 800 px and keep the aspect ratio of the image. The result is a batch of images with the same width 800 px, but variable height e.g. 645 px, 721 px, 434 px. 

To tidy up the image and keep a uniform shape I'd like to add a white background of 800 px , 800 px with the resized imaged centred on top of that background. I won't be able to achieve it manually as there are coming on 10,000 images.

Is there some functionality that I'm not utilising? I've looked around batch jobs, and had no success with macro's as the saved macro will only run off the applied rules given to the specific image the macro was recorded upon.

I've got stuck with the transform marco command as it is working via a percentage and not a finite pixel value, and will apply a white background of varying height dimensions to any image given to process.

Does anyone have any ideas how to achieve this?

many thanks in advance,

Eddie

Link to comment
Share on other sites

5 hours ago, Eddie Evz said:

The result is a batch of images with the same width 800 px, but variable height e.g. 645 px, 721 px, 434 px. 

Off the top of my head and assuming you have already resized the images as above...

Add (or paste) a white rectangle (size 800 x 800px) at x=0, y=0 coordinates

Arrange > Move to back

Document > Unclip canvas

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.

Link to comment
Share on other sites

Many thanks Carl, that does get around the transform issue within the macro. I'm still having trouble pasting the 800x800 square in the centre of the image, it seems to either fix to the top or bottom, or slightly skewed left or right etc.

I've tried the different paste options without success, when you say paste at the correct coordinates, how do I define the paste parameters so the white square will always be applied to the centre of the image, irrespective of the images variable height, is there a paste function that states, "paste centre" of image?

 

Link to comment
Share on other sites

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.