Solved Auto Zoom potential issues


Auto Zoom potential issues
#1
While generating images for the PT, I've noticed that sometimes LDView's auto zoom results in some of the part being cropped. Here's an example:
https://library.ldraw.org/tracker/32684

I can post the LDView.ini the PT is using if needed.
Reply
RE: Auto Zoom potential issues
#2
(2024-01-27, 14:42)Orion Pobursky Wrote: While generating images for the PT, I've noticed that sometimes LDView's auto zoom results in some of the part being cropped. Here's an example:
https://library.ldraw.org/tracker/32684

I can post the LDView.ini the PT is using if needed.

It looks like autocrop is working purely off of the RGB colors and not the RGBA (even though you have transparent background enabled). A temporary fix would be to set LDView's background color to 0xFFFEFF (-BackgroundColor3=0xFFFEFF on the command line, or the equivalent in ~/.ldviewrc) so that it is unlikely to exactly match any protruding detail in rendered parts. I will see about updating autocrop to pay attention to the alpha channel in the image if that is present. Note: the background color I proposed makes the green channel the minimum amount darker than the red and blue channels, so should look visually white. You could probably also use 0xFEFEFE.
Reply
RE: Auto Zoom potential issues
#3
(2024-01-27, 22:08)Travis Cobbs Wrote: It looks like autocrop is working purely off of the RGB colors and not the RGBA (even though you have transparent background enabled). A temporary fix would be to set LDView's background color to 0xFFFEFF (-BackgroundColor3=0xFFFEFF on the command line, or the equivalent in ~/.ldviewrc) so that it is unlikely to exactly match any protruding detail in rendered parts. I will see about updating autocrop to pay attention to the alpha channel in the image if that is present. Note: the background color I proposed makes the green channel the minimum amount darker than the red and blue channels, so should look visually white. You could probably also use 0xFEFEFE.

I updated LDView's code to automatically use the alpha channel for cropping any time images are saved with transparent background enabled (which appears to be the case for ldraw.org's PT images). If you're willing to try pulling from git and rebuilding, it will hopefully fix the problem without needing the background color workaround. However, I'm not sure how easy it is to update and build the source tree you already have (although I know you made a minor change a while back).
Reply
RE: Auto Zoom potential issues
#4
It's relatively trivial do a git pull and rebuild. I'll give it a go later tonight.
Reply
RE: Auto Zoom potential issues
#5
(2024-01-28, 2:50)Orion Pobursky Wrote: It's relatively trivial do a git pull and rebuild. I'll give it a go later tonight.

Sounds good. Note that you might have to git stash for the pull to work with your local fix for the clipping problem that was happening on certain parts. I would guess that git stash pop would succeed without merge conflicts after the pull, though.
Reply
RE: Auto Zoom potential issues
#6
I pulled from master, reapplied the clip radius fix, and rebuilt. The regenerated image is now correct. Thanks for the quick fix.
Reply
« Next Oldest | Next Newest »



Forum Jump:


Users browsing this thread: 1 Guest(s)