groucho86
25th September 2020, 23:34
I have a 1998x998 source that I need to "fit all" within a 1920x1080 container.
That means resizing 1998x998 to ~1920x959.04 and padding top and bottom to fill the height to 1080.
I'm currently scaling first to 1920x960 then padding top and bottom but then I'm not getting a perfect 1:1 compared to other softwares.
Ideally I'd like to preserve subpixel accuracy but I'm struggling with using src_top, src_height, etc.
Anyone know of a convenience function to resize & pad while keeping the image perfectly centered?
That means resizing 1998x998 to ~1920x959.04 and padding top and bottom to fill the height to 1080.
I'm currently scaling first to 1920x960 then padding top and bottom but then I'm not getting a perfect 1:1 compared to other softwares.
Ideally I'd like to preserve subpixel accuracy but I'm struggling with using src_top, src_height, etc.
Anyone know of a convenience function to resize & pad while keeping the image perfectly centered?