View topic - Cropping

Cropping

General discussion on lighting, backgrounds, Global Illumination, rendering parameters and tonnemapping.

Cropping

Post Tue Mar 15, 2016 8:37 am

Hi guys,

Recenty I did a cropping test with luxrender (becaue I do lot at work) and I also did with yafaray. What I've seen is that there is an offset of one pixel on the vertical component:

This is the result I obtain by substracting the cropped layer to the background, it should be black:
croptest_yaf_1.jpg



And this is what I obtain when I move one pixel up the cropped layer (correct):
croptest_yaf_2.jpg


Regards!
Attachments
crop_test_yaf.7z
(304.93 KiB) Downloaded 66 times
surena
 
Posts: 90
Joined: Sat Apr 26, 2014 6:37 am
Location: Spain

Re: Cropping

Post Thu Mar 17, 2016 8:44 am

Sorry,

David, did you get time to check if this is a bug?

Thanks. :wink:
surena
 
Posts: 90
Joined: Sat Apr 26, 2014 6:37 am
Location: Spain

Re: Cropping

Post Tue Mar 22, 2016 6:10 pm

Hello,

I'm looking at it but not yet sure.

As soon as find something I will let you know.
User avatar
David Bluecame
 
Posts: 343
Joined: Mon Jan 21, 2013 12:42 pm
Location: Spain

Re: Cropping

Post Wed Mar 23, 2016 6:51 am

Hello,

I believe this is a bug, and I've solved it in my developing branch. It will be fixed in the next YafaRay-E version.

If you want to try this fix, you can do a change in your current v2.1.1 exporter:

file: yafaray/io/yaf_scene.py
replace this section:
# no border when rendering to view
if render.use_border and cam_data:
minX = render.border_min_x * sizeX
minY = render.border_min_y * sizeY
maxX = render.border_max_x * sizeX
maxY = render.border_max_y * sizeY
bStartX = int(minX)
bStartY = int(sizeY - maxY)
bsizeX = int(maxX - minX)
bsizeY = int(maxY - minY)

with this:
# no border when rendering to view
if render.use_border and cam_data:
minX = render.border_min_x * sizeX
minY = render.border_min_y * sizeY
maxX = render.border_max_x * sizeX
maxY = render.border_max_y * sizeY
bStartX = int(minX)
bStartY = int(sizeY) - int(maxY)
bsizeX = int(maxX) - int(minX)
bsizeY = int(maxY) - int(minY)


Please let me know if this works for you. This change will be included in the next YafaRay-E version.
User avatar
David Bluecame
 
Posts: 343
Joined: Mon Jan 21, 2013 12:42 pm
Location: Spain

Re: Cropping

Post Wed Mar 23, 2016 8:26 am

Sorry, same error.

Edit: Also,

As you can see, when set the cropping to the top, yaf outputs a gap between the image and the border, whis is of one pixel.

Screenshot - 23_03_2016 , 9_26_10.png


Thanks
Last edited by surena on Wed Mar 23, 2016 8:51 am, edited 1 time in total.
surena
 
Posts: 90
Joined: Sat Apr 26, 2014 6:37 am
Location: Spain

Re: Cropping

Post Wed Mar 23, 2016 8:39 am

Look at this, you will see there are differences between region and render.

Screenshot - 23_03_2016 , 9_35_46.png


Edit: Could be a rounding problem?
surena
 
Posts: 90
Joined: Sat Apr 26, 2014 6:37 am
Location: Spain

Re: Cropping

Post Wed Mar 23, 2016 8:18 pm

Hello,

Are you sure you applied the changes correctly? With these changes, in the scene you attached I now get the same results in Blender and YafaRay (see attached images)

Please double check that you replaced that entire section and try again please.
Attachments
crop_test_yaf_YafaRay.jpg
crop_test_yaf_BI.jpg
User avatar
David Bluecame
 
Posts: 343
Joined: Mon Jan 21, 2013 12:42 pm
Location: Spain

Re: Cropping

Post Thu Mar 24, 2016 11:16 am

Oh! Don't know what happened, maybe I copied something wrong.

Now it is working as expected!

Thanks!!
surena
 
Posts: 90
Joined: Sat Apr 26, 2014 6:37 am
Location: Spain


Return to Lighting and Rendering



Who is online

Users browsing this forum: No registered users and 1 guest

cron