The photons generated by the electron avalanche in gaseous detectors are known as the secondary scintillation light, of which the spectrum range is from ultraviolet to visible. So it is possible to collect directly the avalanche-induced photons in visible range by light sensors, such as charged-couple device (CCD). The optical readout is a new method for 2-D imaging of high spatial resolution based on the micro-pattern gaseous detectors (MPGDs). The traditional charge readout method for the MPGDs is complicated, expensive, and strongly depends on the technology of application-specific integrated circuit. In some cases, for example, low-frame-rate 2-D imaging, the optical readout has more advantages, such as simple, cheap and easy to use. Therefore, a gaseous detector was developed based on the thick gaseous electron multiplier (THGEM) and the ordinary scientific CCD camera as readout to realize the X-ray imaging instead of charge readout. The THGEMs with $$60\times 60\,\hbox {mm}^2$$ sensitive area were developed to reach high gain, and the $$\hbox {Ar} + \hbox {CF}_4$$ gas mixture was chosen for strong light emission. And so a general scientific CCD can be used for readout and replacing the intensified CCD, which is more expensive than general CCD. Some clear X-ray images were obtained by this optical readout THGEM detector, and the spatial resolution achieved is $$275\,\upmu \hbox {m}$$ . It is indicated that this kind of detectors have promising imaging capability and great potential for practical application.