> In fact, I'm doing it in PHP and using the API Rest but I tested also in a terminal
> as in PHP I get the same error. All png images from rrd are bad.
I guess you simply use the wrong url (/api2/json/) - you should use /api2/png instead:
https://your.host.com:8006/api2/png/nodes/{NODE}/openvz/{VMID}/rrd?timeframe=day&ds=cpu