1. An image forming apparatus comprising: an image carrier that carries a toner image; a transfer member that is opposed to the image carrier; a hardware processor configured to determine a magnitude of a transfer voltage to be applied to the transfer member so that the toner image is transferred from the image carrier to a print medium passing between the transfer member and the image carrier; a first voltage application device that applies the transfer voltage to the transfer member; a separation member to which a separation voltage is applied so that the print medium is separated from the image carrier; a second voltage application device that applies the separation voltage to the separation member; a sensing device that senses an image density of the toner image; and wherein the hardware processor controls a magnitude of the separation voltage based upon the image density of the toner image and the hardware processor further controls the magnitude of the transfer voltage based on the magnitude of the separation voltage.