How to encode a time series as an image to feed it into CNN?
You can encode time series to images using image encoding methods like Recurrence Plots (RP), Gramian Angular Field (GAF), Markov Transition Field (MTF).

See the following article:

Estebsari, A.; Rajabi, R. Single Residential Load Forecasting Using Deep Learning and Image Encoding Techniques. Electronics 2020, 9, 68.
https://doi.org/10.3390/electronics9010068