A controller has an image processing unit that performs various types of image processing. The image processing unit has a memory unit that sets IDs by expressing a plurality of pixel values in a series of bits and stores computation results obtained by combining all of the pixel values by associating with the IDs in advance, and a reading unit that reads the computation result stored in the memory unit using the ID obtained by expressing the plurality of input pixel values in a series of bits.