0
$\begingroup$

For cases where we want to batch process an image into multiple versions, it's fairly straightforward if only changing the scale. But if we want to vary the cropping things get complicated. This is because using the Scale node's Crop mode on either Render Size or Scene Size. Neither of these values can have multiple instances or be key-framed to change over time.

Trying to figure out how to crop and resize to more than one version

In the screen shot above, the resizing (cropping) only works correctly because the Render Size is set correctly.

But this can only be done once. Even if we create another scene with different render dimensions, only the current scene gets used by the Scale node.

Using the Scale node in Absolute mode causes stretching instead of cropping.

It seems like there should be a way to do this. Am I overlooking something?

Update: I've made some progress with the size by using a Translate node followed by a Crop node, but the crop is off-center.

Cropping to the correct size, but is not centered

$\endgroup$
13
  • $\begingroup$ It could possibly be done with Python. Could you tell more about the batch process you need? $\endgroup$ Aug 8, 2018 at 16:30
  • 1
    $\begingroup$ @MartinZ Your comment made me realize I'm probably using the wrong software. I think I should be using imagemagick for this, not Blender. Still, it's frustrating to think that maybe Blender can't do it... Blender can do ANYTHING! ;-) $\endgroup$
    – Mentalist
    Aug 8, 2018 at 16:49
  • 1
    $\begingroup$ It's possible in Blender, but it will be easier to do with Imagemagick. $\endgroup$ Aug 8, 2018 at 20:27
  • 1
    $\begingroup$ @MartinZ Update: While doing this in Ps was working, some aspects of the Actions flow was annoying me, so I decided to give imagemagick another try. I got some help over at Stack Overflow and now have a script that does exactly what I want - instantaneously. :-) $\endgroup$
    – Mentalist
    Aug 10, 2018 at 13:04
  • 1
    $\begingroup$ This is usefull. Thanks for sharing the solution. $\endgroup$ Aug 10, 2018 at 14:19

1 Answer 1

0
$\begingroup$

This can't be done in Blender, because the image pixel dimensions will always be that of the Scene from which the Render button was pushed.

I used a File Output node to test this, saving rendered data from different Scenes, each with different render dimensions. Their dimensions were overridden by the dimensions of the main Scene.

I'll post the .blend for anyone curious. It's nothing special.

What this means is that even if you use nodes to get the scaling and cropping right, you will just end up with transparency around the image. (If scaling up your image will be clipped instead.)

This sort of task should be done with other software, such as imagemagick or Photoshop (using Actions). Here is how to do it with imagemagick using scripting.

$\endgroup$
1
  • 1
    $\begingroup$ You have Python in Blender. There is no such a thing as 'can't be done'. You can batch process a folder with images in Blender with a script changing the dimensions and rerendering the compositor nodes only with Render Layer nodes muted. It is not as elegant or practical as with ImageMagick though. $\endgroup$ Aug 10, 2018 at 14:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .