Skip to content

Comments

feat: add new image scaling modes#1699

Open
ozcode2009 wants to merge 1 commit intoCasparCG:masterfrom
ozcode2009:scale-mode-align
Open

feat: add new image scaling modes#1699
ozcode2009 wants to merge 1 commit intoCasparCG:masterfrom
ozcode2009:scale-mode-align

Conversation

@ozcode2009
Copy link
Contributor

@ozcode2009 ozcode2009 commented Jan 26, 2026

#1566 added support for new scaling modes, allowing for images' aspect ratios to be transformed in standard ways to get scaling modes like fit, fill, original, hfill, and vfill.

However, often with content that does not match the aspect ratio of the consumer, the image must be centered. This PR adds support for new scaling modes that are the same as the 5 added in #1566 but include a _CENTER eg. FIT_CENTER, which both fits and centers the image.

@dimitry-ishenko
Copy link
Contributor

dimitry-ishenko commented Feb 2, 2026

@ozcode2009 could you explain what the difference is? I thought the original aspect already did that...

@ozcode2009
Copy link
Contributor Author

With the original scaling modes, the image is always top-left aligned.
This adds "center" modes such that the image can be easily center aligned. This can be important in workflows where, for example, a vertical video must be played out on a widescreen feed, where the video must both maintain its original aspect ratio and be centered.

@dimitry-ishenko
Copy link
Contributor

@ozcode2009 it's been a while since I've looked at these, but if memory serves me well, you just need to set MIXER ANCHOR to .5 .5 and the scaling will be center aligned. Could you try that? I don't have a box at hand at the moment.

@Julusian
Copy link
Member

Julusian commented Feb 9, 2026

I feel like I remember changing the anchor like that works.

Maybe it would be worth considering changing the default anchor (and potentially other properties) to be the middle, to make this simpler? I'm pretty sure it has annoyed me before when scaling things even manually.
With an config field to restore the old behaviour for those who rely on it

@dimitry-ishenko
Copy link
Contributor

Maybe it would be worth considering changing the default anchor (and potentially other properties) to be the middle, to make this simpler? I'm pretty sure it has annoyed me before when scaling things even manually.

Same here. In more cases than not, it seems the expectation is that the anchor is at the center of the image.

@pa3mve
Copy link

pa3mve commented Feb 10, 2026

I guess default anchor points should be something to configure. Me working in the LED market scaling and positioning from top left is ideal, but ican understand this is different for other users.

@ozcode2009
Copy link
Contributor Author

When I get some free time I'll write a new config option that will set a default mixer anchor point for scaled content if that satisfies everyone's interests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants