A method is disclosed for adjusting a collimator of an X-ray source. In an embodiment, the method includes detecting an arrangement of an X-ray detector with respect to the X-ray source; automatically determining an adjustment for the collimator based on the detected position of the X-ray detector with respect to the X-ray source; and automatically adjusting the collimator based on the determined adjustment for the collimator. An X-ray device and computer readable medium are also disclosed.