How to display image?Example1 and example2 got some error

Both examples work well on the online simulator:

But both examples are assuming 32bit color format, which is incompatible with ili9341 of the m5stack.

There is a better way - using the imagetools library.
The advantages are:

  • Takes care of PNG header and data decoding in several color formats
  • Fast - it uses the viper code emitter for processing the image data.

Here is a usage example: