A medicine inspection device, an image processing device, an image processing method, and a program are provided that appropriately extract identification information even when the positional relationship between a printed character and an engraved mark added to a medicine is not constant. The above problem is solved by an image processing device that performs a process of enhancing a printed character portion of a medicine based on at least one image taken with a surface of the medicine being irradiated with light to generate a printed-character-enhanced image, performs a process of extracting only an engraved mark portion from a three-dimensional shape of the medicine based on at least three images taken with illumination directions of the light to the surface of the medicine different from each other to generate an engraved-mark-extracted image, and generates a difference image between the printed-character-enhanced image and the engraved-mark-extracted image.