When a circuit pattern is detected by an image sensor, degradation of the modulation of the detected image is inevitable. For automatic detection of defects in a pattern by image processing, a less degraded image is desirable. This paper presents a simple method to restore degraded modulation of a detected image. The method is intended for a practical image processing system. Its feature is that modulation compensation can be performed in real-time by a hard-wired logic circuit, so it can be implemented as a relatively simple circuit.