Hydrogen peroxide treatment induces the phase transformation of hexagonal ZnO to cubic ZnO2 on the surface of the ZnO switching memory film; this oxidation process effectively reduces the concentration of n-type donor defects (oxygen vacancies and zinc interstitials) in the switching film. The chemically oxidized ZnO2 layer not only lowers the operation current of the device but also can serve as an oxygen "bank" to improve the endurance of the memristor. The oxidation reaction of peroxide treatment can be easily controlled to achieve an analog behavior with good switching uniformity. The analog memristor device is able to perform two-bit per cell and synaptic operations. Based on the experimental synaptic data, an image processing of 7 × 9 pixels using a simulated artificial neural network comprises 63 synapses is evaluated to mimic the visual cortex function of the brain.