Open Krita, open an image and goto Image->Resize Canvas... You can then play around with the boxes, make them become red if you write a wrong expression (everytime the expression is valid you will see the size preview update, the corresponding offset and, if keep ratio is the to true, the other box and offset).