How do I render only part of an image via the command line?
This can be done via a script (external or internal of the .blend file).

I shall name by script textblock script.

import bpy
import sys
argv = sys.argv
argv = argv[argv.index("--") + 1:]

scn = bpy.data.scenes["Scene"]

# get the frame arg
frame = int(argv[4])

# go to the desired frame
scn.frame_set(frame)

# set a unique output path
scn.render.filepath = "//dir/" + str(frame).zfill(4)
for i in range(0, 4):
    scn.render.filepath += "_" + argv[i]


# setup the render border
scn.render.use_border = True
scn.render.border_min_x = float(argv[0])
scn.render.border_max_x = float(argv[1])
scn.render.border_min_y = float(argv[2])
scn.render.border_max_y = float(argv[3])

# render a still frame
bpy.ops.render.render(write_still=True)
print("Success.")


The script expects 5 arguments as the console input:
- border_min_x
- border_max_x
- border_min_y
- border_max_y
- frame number to render

These arguments are parsed and a frame is then rendered and written, when the script is executed.

To call the script with params, add them after two dashes.


  Having spaces around -- is important, this is a signal that Blender should stop parsing the arguments and allows you to pass your own arguments to Python.


Then in the command line, execute the following command:

blender -b my_file.blend --python-text script_textblock -- float_min_x float_max_x float_min_y float_max_y int_frame


Example

blender -b my_file.blend --python-text script -- 0.1 0.5 0.2 0.8 1