1

We have over 200 images that we need inserted into a PSD like this -- one that features this image on the wall -- and we want to automate the process. What would be the best way to do it? enter image description here

6
  • 2
    You need to record an action and use it to batch afterwards. Have you tried that?
    – Wolff
    Jul 5, 2022 at 15:10
  • Same 'painting' different rooms? Do they all line up exactly? Do many of them have foreground intersecting the painting?
    – Tetsujin
    Jul 5, 2022 at 15:30
  • @wolff What would be the best way of going about that?
    – User930223
    Jul 7, 2022 at 0:36
  • @Tetsujin different painting, same room. Also, the painting isn't square.
    – User930223
    Jul 7, 2022 at 0:36
  • @user287001 Seems like I'd still have to manually place all of these things though, no?
    – User930223
    Jul 7, 2022 at 0:37

1 Answer 1

1

If this is for a product website, you should try using imagemagick or something that can be installed on the server to create these on the fly. This will give you direct access to the product database and any real-world size information.

I have done this using "for-hire" code that I cannot post, but the process is basically this:

  • background image. You need to know the width of the image in pixels, and the "actual size" (real-world measurement) of the wall space depicted. Then you can calculate how many pixels per millimeter you will be using.[1]

  • image of painting. You will need to know how many pixels the image is, along with the actual real-world size of the painting depicted. Again, this allows you to find the number of pixels per millimeter for this image.[1]

  • normalize the scale of the painting image to the scale of the background image

  • define the (x and y pixel position) on the background image which will be the center point of the scaled painting image; calculate the where the top left origin point of the painting image will fall by subtracting 1/2 width and 1/2 height from the center point.

  • composite the two

In my particular case, I did this offline using (windows) vbscript and an inventory database. Imagemagick was accessed via a scriptable object (i.e. objImageMagick = CreateObject("ImageMagickObject.MagickImage.1"), but the command-line version can also be used. The final command after normalizing the scale of the painting image to the background image and calculating the top left origin looks like:

objImageMagick.Composite("-geometry", "+1021.5+1134.49", "PaintingResizedTemp.tif", "bg_for_scale.jpg", "output.jpg"

My sources were framed images with alpha channel, which were used to mask out anything in the photos outside the frame edge. We also used a "standard frame width" in cases where the database did not include this information.

By scripting it and storing the mm-per-pixel for the background photo, you now can change the background photo at will.

Notes:

  1. This is not (pixels per inch/ppi/pixels per mm). This is more correctly "mm per pixel" in the more classic NASA use of the term resolution.
1
  • Thank you for the comprehensive response. I was told there is in fact a pre-made action / plugin / script I can use to accomplish this by a freelancer, but they are hiding the name of the action from me.
    – User930223
    Jul 6, 2022 at 16:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.