I need to get Pixel coordinates of a rendered image.
Here is explanation: Image Editor

In the Image Editor, I can see the coordinates in the bottom left corner by right clicking in the image. Is it possible to get the coordinates with Python? I need them to setup many crop nodes.

  • $\begingroup$ I want to the almost same thing: get the image pixel coordinate in image editor, is there a simple way to do this? $\endgroup$ – Joey May 11 '16 at 6:07
  • 1
    $\begingroup$ You want to get the pixel coordinates of the image at the mouse cursor's location? $\endgroup$ – TLousky May 11 '16 at 6:52
  • $\begingroup$ This question should state what the input is exactly that you need to convert into coordinates. $\endgroup$ – ideasman42 May 11 '16 at 11:34

It seems I found the way how to get pixel coordinates through Rendering Crop. Select a Crop Node and use the script.

enter image description here

import bpy

scene = bpy.context.scene
nodes = scene.node_tree.nodes
cropNode = nodes.active

if cropNode.type == 'CROP':
    nodes.active.min_x = scene.render.border_min_x * scene.render.resolution_x
    nodes.active.max_x = scene.render.border_max_x * scene.render.resolution_x
    nodes.active.min_y = scene.render.border_min_y * scene.render.resolution_y
    nodes.active.max_y = scene.render.border_max_y * scene.render.resolution_y

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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