I agree with Hovercraft Full of Eels that the right way to do this is to move the center to the upper left corner, scale, and then move the upper left corner back to the center.
However, if you want it to complete it in less than three steps, this conversion:
x ⟼ S (x - c) + c = Sx + (c - Sc),
where S is the scaling transformation, and c is the center in coordinates relative to the upper left position.
So you need to do the scaling and then translate c-Sc.
source share